0

I have a init script which has to start and stop both firstly during system reboot. I was able to achieve this by having a appropriate chkConfig START and KILL order.

Sometimeback only, I have switched to using systemd. But, I don't want to port my initscript to systemd service. So, I am relying on systemd's compatibility with initscripts. But, I see that after switching to systemd, initscript is not able to stop as the first service. Instead, what I see is that chkconfig's KILL order is not being honoured any more in systemd. From a quick look, it seems like, systemd just reverses the start order during killing/stopping services.

So, is there a way to make my initscript start and stop both as the first service to do so during reboot of the system or in general termes, is there a way to make systemd honour chkconfig KILL order ? systemd version which I am using is systemd-201-2.fc18.9.i686

Any help will be appreciated.

  • 1
    Two things: First, your system is far out of date. Update to a current supported Fedora release. Second, you _do_ want to write a systemd unit to start your service. – Michael Hampton Dec 10 '15 at 15:04
  • Yes, I understand that my system is far too outdated. But, for time being. Is there a solution for what I am asking. I have started looking into how port initscripts to systemd services, but there also I don't see a way to make a service start and stop as the very first service during reboot. Can you please help me out. – user3872776 Dec 10 '15 at 15:13
  • First, you need to figure out what its _actual_ requirement is. It's not likely that it needs to be the "first" service to start; rather, that it needs to start before some other event. – Michael Hampton Dec 10 '15 at 15:18
  • Suppose previously, before using systemd I had a initscript with chkconfig start order "01" and stop order "99" or any number less than the KILL order of order remaining init scripts. So, out of all the initscripts this script start firsts and even stops first. I want the same behaviour with systemd too. If it possible in some way to do it without porting to systemd service, then it's great or let me know how to do it through a systemd service. – user3872776 Dec 10 '15 at 15:27
  • Please read and understand what I wrote in the previous comment. – Michael Hampton Dec 10 '15 at 15:33
  • I am sorry but I am just a newbie to all this. On again reading your pervious comment. It seems to me in systemd terms, I need my service to be started right after basic.target completes. I am sorry again, if you think I am still unable to understand your comment. – user3872776 Dec 10 '15 at 15:39
  • I think you still don't understand. Why must your service be started first? – Michael Hampton Dec 10 '15 at 15:40
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/32805/discussion-between-user3872776-and-michael-hampton). – user3872776 Dec 10 '15 at 15:42
  • Hey Michael So, the service is about starting a watchdog. I guess, so it's needs to be started first. On why must my service start first, may be you want me to answer that because the service which starts second depend on it. But, in my case it's watchdog. So, I need to have this started first anyhow and make reboot happen, I need to stop it first only. – user3872776 Dec 10 '15 at 15:53

0 Answers0