Inittab respawn remplacement for systemd

When upgrading to Debian Jessie and welcoming systemd at your home sweet home, it can be disturbing to not have working inittab respwaning services.

As usual, the inittab config line was looking like this:

PL:23:respawn:/path/to/bin/mydaemon

So you will need to put in file /etc/systemd/system/mydaemon.service that code example:

[Unit]
Description=My Respawning Daemon
After=getty.target

[Service]
ExecStart=/path/to/bin/mydaemon
Restart=always

[Install]
WantedBy=multi-user.target

Then to do a “systemctl enable mydaemon.service” for systemd to symlink what it needs.

If you don’t want to reboot for it to work now, use:

systemctl daemon-reload
systemctl start mydaemon.service

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>