Questions tagged [init.d]

init.d (usually /etc/init.d) is a directory holding configurations regarding programs to be started at boot time by the `init` process. For questions regarding the `init` process itself, use [init].

At boot time, the init.d directory is browsed by the init (PID 1) process, which executes all programs expected to run at boot time (daemons, servers, ...).

This tag may be used for questions related to programs starting at boot time. It should be used for systems using the init system, or alternatives also relying on /etc/init.d.

188 questions
45
votes
2 answers

How do I set the user of php-fpm to be php-user instead of www-data?

I am using php-fpm on debian with nginx for php5 support. I would like to have php-fpm to be under the user&group php-user instead of www-data. I thought the init.d script would have the user mentioned or uses a file which has www-data written in…
user4069
44
votes
3 answers

The rc0.d,rc1.d,... directories in /etc

I'm running Ubuntu where I have the directories /etc/rc0.d, /etc/rc1.d, /etc/rc2.d, ..., /etc/rc6.d. Example files from my machine: directory example symlinks in the dir ------------------------------------------ /etc/rc1.d: K76dovecot,…
roger.james
  • 555
  • 1
  • 5
  • 6
21
votes
8 answers

hostapd will not start via "service" -- but will start directly

I am having trouble getting hostapd to start as a service. It fails when I try to start it: $ sudo service hostapd start [FAIL] Starting advanced IEEE 802.11 management: hostapd failed! From what I understand, this uses the configuration in…
gnychis
  • 311
  • 1
  • 2
  • 5
19
votes
1 answer

What is the difference between start-stop-daemon and running with &?

I am setting up a service in /etc/init.d. I am looking at various scripts in there, some are implemented with start-stop-daemon ... and some with /path/to/script &. All of them save the pid in a file and do some checks. What is the best practice,…
Thomas
  • 883
  • 2
  • 12
  • 25
15
votes
2 answers

How secure is keeping non-root owned scripts in /etc/init.d?

I have an application which runs as a daemon and is controlled by a script in /etc/init.d Sometimes we need to change some parameters of startup/control of these scripts and then restart the daemon. These scripts only have write permission for the…
Akaks
  • 449
  • 1
  • 5
  • 10
14
votes
2 answers

Create and control start up scripts in BusyBox

I have compiled a custom linux kernel in BusyBox. BusyBox init does not support runlevels. When the kernel boots up in BusyBox, it first executes init which looks for the specified runlevel in /etc/inittab. BusyBox init works just fine without…
Shantanu Banerjee
  • 449
  • 3
  • 6
  • 15
13
votes
3 answers

disable init.d script in systemd

I changed the init system from sysvinit to systemd on a raspbian installation. The install boots fine, but now starts lightdm on boot. I don't want it to do that. I noticed lightdm.service is started on boot. Stopping the service with systemctl stop…
Martijn
  • 233
  • 1
  • 2
  • 9
10
votes
3 answers

How do I force booting in text mode?

Newer Linux distributions have the idea to boot into graphics modes. The grub menu does this. The init.d system does this. X does this. I can justify X. But both grub and init.d have only caused me troubles and never given me any joys. I am now…
Ole Tange
  • 33,591
  • 31
  • 102
  • 198
9
votes
3 answers

Difference between /etc/init.d/networking restart and invoke-rc.d networking restart

Is there any real difference between /etc/init.d/networking restart and invoke-rc.d networking restart (Debian)?
Lucas Kauffman
  • 1,243
  • 2
  • 12
  • 22
9
votes
2 answers

How to regenerate /etc/init.d/.depend.(boot|start|stop) on Debian?

Suppose one deleted the following files. /etc/init.d/.depend.boot /etc/init.d/.depend.start /etc/init.d/.depend.stop How to regenerate them?
adrelanos
  • 1,786
  • 7
  • 29
  • 56
8
votes
2 answers

How to debug init.d script that isn't being run

I am trying to get god to start during boot on Debian. I added a script to the /etc/init.d/ directory which looks like this. #!/usr/bin/sh ### BEGIN INIT INFO # Provides: god # Required-Start: $remote_fs $syslog # Required-Stop: …
PICyourBrain
  • 193
  • 3
  • 3
  • 9
7
votes
1 answer

How to specify daemon dependency upon another daemon

in /etc/init.d/ first daemon # Provides: first # Required-Start: $remote_fs $syslog second daemon # Provides: second # Required-Start: $remote_fs $syslog first Is this in Debian the correct way to specify the dependency of…
user2080741
  • 71
  • 1
  • 1
  • 2
7
votes
1 answer

Is it possible to write portable service scripts to control a daemon?

I (or one of my colleagues) need to write one or more shell scripts to control the execution of a daemon. We need to be able to start the daemon, tell it to gracefully shut down, and force a shutdown. Basically, it's the sort of thing one would…
Tom Anderson
  • 936
  • 2
  • 7
  • 20
7
votes
1 answer

systemd: default value for environment variable

I would like to migrate some OpenRC init script to systemd but I think that it is general problem of environment variables handling in systemd. Original OpenRC files There is a file e.g. /etc/conf.d/fooservice with contents # value of FOO…
j123b567
  • 365
  • 1
  • 3
  • 9
7
votes
1 answer

Is there an init.d start log?

I am experiencing a problem with an init.d script (the service won't start), so I'm wondering if a log is available so I can fix the problem.
William
  • 584
  • 2
  • 9
  • 27
1
2 3
12 13