Wednesday, May 11, 2016

Systemd Boot Manager


Installation


# add-apt-repository ppa:pitti/systemd
# apt-get update
# apt-get install systemd libpam-systemd systemd-ui

Boot loader configuration


Edit /etc/default/grub :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash init=/lib/systemd/systemd"

*** For an emergency boot without any services use
init=/lib/systemd/systemd systemd.unit=emergency.service


*** Previous Ubuntu use upstart like
init=/sbin/upstart

After any modifies then
# update-grub

Controlling service after booted

systemctl list-units - List all units (where unit is the term for a job/service)
systemctl start [NAME...] - Start (activate) one or more units
systemctl stop [NAME...] - Stop (deactivate) one or more units
systemctl enable [NAME...] - Enable one or more unit files
systemctl disable [NAME...] - Disable one or more unit files
systemctl reboot - Shut down and reboot the system
systemctl list-dependencies [NAME...] - Lists all dependency of service

Remote file system mount after networking ready

Old style use /etc/fstab  but can not check services dependency.

Create file /lib/systemd/system named <mount-unit-name>.mount and has a content

[Unit]
Description=<mountpoint>
Wants=network.target statd.service   // Network Status Monitor service
After=network.target statd.service

[Mount]
What=<server>:<share>
Where=<mountpoint>
Type=nfs
StandardOutput=syslog
StandardError=syslog

Where

  • <mount-unit-name> = Remote shared directory like "/usr/local" then file name is "user-local.mount"
  • <mountpoint>  = Local mount point
  • <server:share> = same manner in /etc/fstab







No comments:

Post a Comment