Skip to content

Instantly share code, notes, and snippets.

@abbotto
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save abbotto/c7e505be5e2bfd5b0a1c to your computer and use it in GitHub Desktop.

Select an option

Save abbotto/c7e505be5e2bfd5b0a1c to your computer and use it in GitHub Desktop.
SystemD Startup and Shutdown Scripts
# PUT HERE: /usr/lib/systemd/system/rc-local-shutdown.service
[Unit]
Description=/etc/rc.local.shutdown Compatibility
ConditionFileIsExecutable=/etc/rc.local.shutdown
DefaultDependencies=no
After=rc-local.service basic.target
Before=shutdown.target
[Service]
Type=oneshot
ExecStart=/etc/rc.local.shutdown
StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=shutdown.target
# PUT HERE: /usr/lib/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
After=network.target
[Service]
Type=oneshot
ExecStart=-/etc/rc.local
ExecStart=-/path/to/additional/script.sh
TimeoutSec=0
StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment