Questions tagged [init.d]

The init.d directory contains a number of start/stop scripts for various services on a Linux system.

The init.d directory contains a number of start/stop scripts for various services on a Linux system.

288 questions
66
votes
7 answers

What's the easiest way to make my old init script work in systemd?

I don't want to do the right thing by creating a new systemd script, I just want my old init script to work again now that I've upgraded my system to an OS that's using systemd. I've briefly researched how to convert init scripts and how to write…
mlissner
  • 990
  • 3
  • 8
  • 17
59
votes
6 answers

"reboot" or "shutdown -r now": what restart command is safer?

We have in our organization around ~500 RedHat Linux machines. On all the machines we installed applications and services under /etc/init.d, and oracle RAC servers. We intend to perform yum updates on all machines and after that take a reboot. So I…
dandan
  • 1,021
  • 4
  • 13
  • 21
49
votes
3 answers

stop apache from asking for SSL password each restart

Using instructions from this site but varying them just a little i created a CA using -newca, i copied cacert.pem to my comp and imported as trusted issuer in IE. I then did -newreq and -sign (note: i do /full/path/CA.sh -cmd and not sh CA.sh -cmd)…
user274
31
votes
2 answers

How to remove/backup script from /etc/init.d/?

I've been working with linux for a while but in a rather simple manner. I understand that scripts in init.d are executed when the os starts but how exactly does it works? What if I want to keep a script but don't want it to start automaticly? Say I…
iDev247
  • 751
  • 1
  • 11
  • 23
30
votes
4 answers

How to find error messages from Linux init.d/rc.d scripts?

In Linux, I've written some scripts to be executed during boot and played around with the various ways of installing them. For larger scripts I'll put in /etc/init.d and link the appropriate /etc/rc.d/rc?.d runlevels. For smaller scripts, I'll…
McKAMEY
  • 635
  • 1
  • 6
  • 13
20
votes
5 answers

Run nginx as a non-root user

I followed this process to installing nginx on my Ubuntu 10.04 Lucid Server http://library.linode.com/web-servers/nginx/installation/ubuntu-10.04-lucid I got lost after the point of creating an init script to start nginx, and then calling…
John
  • 526
  • 1
  • 5
  • 13
19
votes
3 answers

When are scripts inside etc/profile.d executed?

I added some scripts from root inside etc/profile.d to execute at startup time. But when will these scripts be executed if I login into system as a non root user? I want to start LDAP-server at start-up time, independently from which user has first…
MyTitle
  • 501
  • 1
  • 8
  • 18
18
votes
3 answers

PHP-FPM does not automatically start after reboot

I'm running PHP-FPM and Nginx, occasionally, for whatever reason, I have to reboot the server. Once the server is running again, the nginx service automatically starts, however, PHP-FPM does not. This can be seen when I run the command sudo…
SteveEdson
  • 1,479
  • 3
  • 12
  • 23
17
votes
2 answers

How to automatically start mysql after server restart (CentOS + other distros)?

How would I configure my CentOS Linux server to automatically start mysql when the server is started following a shutdown? I'm aware of the init.d path... /etc/rc.d/init.d ...and I can see mysqld in this folder. I believe that placing items (i.e.…
therobyouknow
  • 471
  • 4
  • 8
  • 18
16
votes
5 answers

Standard or best way to keep alive process started by init.d

I'm looking for a standard way or best practice to keep a daemon started by an init.d shell script alive. Or even better, is there a way to keep it alive directly from /etc/init.d? Specifically, I have a daemon called dtnd with and infinite loop…
Adrian Antunez
  • 473
  • 1
  • 5
  • 10
13
votes
4 answers

Starting a script as another user

I've created a script in /etc/init.d/ which has to run several other scripts from other (non-root privileged) users from their home directories, as if they started them. I launch these scripts with: sudo -b -u
Ivan Kovacevic
  • 1,671
  • 3
  • 14
  • 19
12
votes
1 answer

What is status_of_proc, and how do I call it?

In the init script of nginx in Debian 7 (Wheezy) I read the following exerpt: status) status_of_proc -p /var/run/$NAME.pid "$DAEMON" nginx && exit 0 || exit $? ;; This code runs just fine and sudo service nginx status…
Rovanion
  • 569
  • 3
  • 6
  • 22
12
votes
2 answers

Running arbitrary program as daemon from init script

I need to install a program as a service in Red Hat. It doesn't background itself, manage its PID file, or manage its own logs. It just runs and prints to STDOUT and STDERR. Using the standard init scripts as guides, I've developed the…
user48802
11
votes
5 answers

How can I automatically restart a process after it terminates?

I've got a golang program that I want to restart after it terminates on a Debian Squeeze box. The thing is serving HTTP behind an Apache 2 mod_proxy setup. I don't expect the process to fail, but I'd like to have some insurance against it. On…
Deleted
  • 294
  • 1
  • 2
  • 6
10
votes
4 answers

init.d scripts written in Python

A question came up on StackOverflow asking about writing init.d scripts in Python. One comment indicated that these scripts should be programmed in shell, not Python. Is writing init.d scripts in Python: Bad. Bad. Bad. Never do this. Not a…
mjhm
  • 265
  • 2
  • 6
1
2 3
19 20