[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to make systemd execute init.d script status statements?



On Mon, May 16, 2016 at 09:36:46PM +0300, Juha Heinanen wrote:
When I upgraded one of my wheezy hosts to jessie, I noticed that

/etc/init.d/<my own daemon> status

command stopped working.

Looks like systemd does not execute the statements in status) case of
the init script at all, but just checks if the daemon process exists.
My '/etc/init.d/<my own daemon> status' did much more, i.e., it checked
if the daemon was actually able to do some real work.

So far I have had no luck in finding the answer from the web.

-- Juha

On the face of it, this *should* still work. When you invoke "/etc/init.d/example status", you're running the shell script directly - that is, without any reference to systemd. Now, I don't remember the details, but I seem to recall there being a command (which a skeleton shell script might import from somewhere) that says "Is systemd running? In which case pass the argument to that", but without seeing the contents of your script I can't say if it's doing that.

Try adding "set -x" at the top of your script to help with debugging it?



--
For more information, please reread.

Attachment: signature.asc
Description: PGP signature


Reply to: