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

Re: Debian 8 how to install and run init.d scripts?



Hi,

thank you for your reply.

On Fri, Oct 18, 2019 at 3:34 PM Jonas Smedegaard <jonas@jones.dk> wrote:
Quoting Steffen Dettmer (2019-10-18 15:17:10)
> in short: how to use "init.d" scripts on Debian?

In short:

  service $SERVICE stop

Thanks for the tip. man insserv does not tell about service, and neither man init.

Anyway, it does not work.

I created a new file and:

  root@node17-0:/etc/init.d# service gitlab-runner2 start
  Failed to start gitlab-runner2.service: Unit gitlab-runner2.service failed to load: No such file or directory.

(It is a 230 line wrapper to call a shell script with a single parameter, which calls a binary with more than 100 command line options - to call a shell script. Unfortunately, no --debug or --verbose. Using strace showed, that this binary seems to send socket commands only, so it seems it communicates with some complex server. To start a shell script with a single parameter. And it does not work.)
 
> in detail:
>
> On one server a init.d script with LSB header does not work, at least
> when started by command line.

Diving into the rabbit hole of messing directly with those files,

Unfortunately I don't understand what you mean.
Do you mean, I shall not have any own software on Debian?
 
I suggest to start here:
  man service

Obviously, the man page is outdated. Tracing the service script (bash -x) shows 83 lines of output ending with:

  exec systemctl start gitlab-runner2.service

so actually the script delegates to "systemctl", which is something from systemd, which is not described in the man page at all.

I still think systemd makes some magic when called with DPKG_MAINTSCRIPT_PACKAGE set...

Steffen



Reply to: