Let's say you have a SysV Init Script named foo
-
Copy the file to
/etc/init.d/foo -
Enable the SysV service:
chkconfig --add foo -
Enable the SysV service:
chkconfig foo on -
Start the service:
service foo start. After this, systemd-sysv-generator will generate this file/run/systemd/generator.late/foo.service, copy this file to/etc/systemd/systemby running:cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service -
Edit
/etc/systemd/system/foo.serviceby runningsystemctl edit foo.service, add in the following line tofoo.servie(this makes the service installable)[Install] WantedBy=multi-user.target -
Enable the service:
systemd enable foo.service -
(Optional) You can then remove the SysV script by running
chkconfig foo off && chkconfig --del foo
Hi,
I'm struggling to get this working on CentOS 7 as well as on SUSE SLES 12.
In step 4, /run/systemd/generator.late/.service is not being generated.
Apparently "systemd-sysv-generator" is nowhere to be found on the system.
Any ideas?
Tx!