Questions tagged [init.d]

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

Filter by
Sorted by
Tagged with
71 votes
7 answers
141k views

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 ...
mlissner's user avatar
  • 1,090
60 votes
6 answers
111k views

"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 ...
dandan's user avatar
  • 1,081
50 votes
3 answers
156k views

stop apache from asking for SSL password each restart [duplicate]

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 ...
user avatar
31 votes
2 answers
70k views

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 ...
iDev247's user avatar
  • 751
30 votes
4 answers
116k views

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/...
McKAMEY's user avatar
  • 635
26 votes
3 answers
63k views

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-...
MyTitle's user avatar
  • 571
21 votes
5 answers
83k views

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 ...
John's user avatar
  • 536
18 votes
4 answers
29k views

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 ...
SteveEdson's user avatar
  • 1,549
17 votes
2 answers
47k views

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 ...
therobyouknow's user avatar
16 votes
5 answers
26k views

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 ...
Adrian Antunez's user avatar
13 votes
4 answers
45k views

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:...
Ivan Kovacevic's user avatar
13 votes
1 answer
14k views

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 $? ;; ...
Rovanion's user avatar
  • 639
12 votes
2 answers
23k views

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 ...
user avatar
11 votes
5 answers
22k views

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'...
Deleted's user avatar
  • 294
11 votes
4 answers
5k views

Can I make systemd show service status after starting or stopping a service?

I am trying to get systemd to do what init.d scripts would do, showing the status of a service automatically after being manually given a command to start or stop. Is this somehow possible? systemd ...
ck_'s user avatar
  • 469
10 votes
4 answers
3k views

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 ...
mjhm's user avatar
  • 265
9 votes
2 answers
4k views

Call to daemon in a /etc/init.d script is blocking, not running in background

I have a Perl script that I want to daemonize. Basically this perl script will read a directory every 30 seconds, read the files that it finds and then process the data. To keep it simple here ...
tony's user avatar
  • 191
8 votes
5 answers
28k views

Supplying password to openconnect started via start-stop-daemon

I am attempting to start openconnect via a Debian init script that makes use of start-stop-daemon: DAEMON=/usr/sbin/openconnect DAEMON_ARGS="<endpoint> --script /etc/vpnc/vpnc-script --user <...
Thilo-Alexander Ginkel's user avatar
8 votes
2 answers
12k views

How do I run a Debian init.d script manually, not at boot?

How do I stop an init.d server from running on boot, but still allow running it manually?
Matthew Flaschen's user avatar
8 votes
1 answer
18k views

insserv: There is a loop between service foo and bar if started... Breaks aptitude

Does anyone know how to resolve these init errors that happen from the Cyberpower powerpanel for linux package? Ref: http://www.cyberpowersystems.com/products/management-software/ppl.html - I tried ...
NginUS's user avatar
  • 468
8 votes
1 answer
13k views

PATH issues for init.d scripts on startup

I have a simple script that starts up a unicorn instance (on Ubuntu 12.04LTS). #!/bin/sh case "$1" in start) echo "starting" cd /path && bundle exec unicorn -c /path/config/...
Peterdk's user avatar
  • 183
8 votes
2 answers
23k views

Getting shell script to run as a daemon on CentOS?

EDIT: For some reason half of my post got truncated, not sure what happened. I will update soon and will post that it is updated here at the top. EDIT: I have updated the post again, sorry for the ...
Lester Peabody's user avatar
7 votes
2 answers
13k views

Passing Arguments to a Service started with Init.d

I want to start mysql with the command argument "--log=log_file_name" What is the proper way to do that when starting it with /etc/init.d? Would it be like this? /etc/init.d/mysql start --log=...
JamesHoux's user avatar
  • 277
7 votes
1 answer
294 views

Is it possible to use perl, python, php, ruby or whatever to write init.d scripts?

I'm new to this SysOp stuff, so I'm wondering if it's possible to use other interpreted languages to write init.d scripts? The upfront diff for me is /bin vs. /usr/bin #!/bin/sh versus #!/usr/bin/...
Lockhead's user avatar
7 votes
1 answer
2k views

Providing normal users(non-root) with initialization and shutdown auto-run capabilities

I'm hosting an experimental/testing Linux box, running Debian Wheezy 7.4.0 distribution. Different users log into the machine over ssh to their accounts and are allowed to run the development tools ...
Ivan Kovacevic's user avatar
7 votes
4 answers
4k views

No coredumps for daemons started at boot by init.d on Ubuntu

How can I get daemons started by init.d at boot to coredump on Ubuntu? This is what I have done so far... echo "ulimit -c unlimited" >> /etc/profile mkdir /corefiles/ chmod 777 /corefiles/ echo ...
user16517's user avatar
  • 233
6 votes
2 answers
8k views

Parse error in sudoers file

I've created a user called kafka to whom I am trying to give a sudo access to run only /etc/init.d/kafka commands. I added the following entry to /etc/sudoers.d/kafka via Ansible: kafka ALL = ...
jeffreyveon's user avatar
  • 3,295
6 votes
2 answers
24k views

Start PHP-FPM with root option automatically

I was trying to get PHP-FPM running a pool as root, but I can't seem to adjust the init.d startup params. It works when starting PHP-FPM from the CLI (with sudo php-fpm7.0 -DRy /etc/php/7.0/fpm/php-...
redelschaap's user avatar
6 votes
1 answer
3k views

Is there a way to control filesystem access with systemd?

So I'm diving into the intricacies of systemd and it's ability to meter resources with cgroups like cpu, io, and memory. Is there also a way to control the directories a process has access to with ...
Jonathan S. Fisher's user avatar
6 votes
3 answers
16k views

Service is not starting on Centos on boot

I have a service installed to start jasper reporting server on boot. I believe it is correctly setup. here is the startup script placed in /etc/init.d/jasperserver #!/bin/sh ### BEGIN INIT INFO # ...
silverdagger's user avatar
6 votes
1 answer
10k views

Launching a PHP daemon from an LSB init script w/ start-stop-daemon

I'm writing an lsb init script (admittedly something I've never done from scratch) that launches a php script that daemonizes itself. The php script starts off like so: #!/usr/bin/env php <?php /*...
EvanK's user avatar
  • 247
6 votes
1 answer
15k views

placing shell script under systemd control

Assuming I have a shell script like this:- #!/bin/sh # cherrypy_server.sh PROCESSES=10 THREADS=1 # threads per process BASE_PORT=3035 # the first port used # you need to make the PIDFILE dir and ...
Calvin Cheng's user avatar
  • 1,166
6 votes
3 answers
14k views

Centos 6.5 auditd fails to start with service or /etc/init.d/audit start

Fail: # service auditd start Starting auditd: [FAILED] Fail: # /etc/init.d/auditd start Starting auditd: [FAILED]...
Jepper's user avatar
  • 376
6 votes
3 answers
3k views

Have FishEye+Crucible start at boot on Ubuntu

I asked this question at Atlassian but figured serverfault might be more appropriate as it's more of a sysadmin question than an Atlassian question: I have been attempting to follow this guide to ...
xref's user avatar
  • 273
6 votes
4 answers
2k views

postgresql on Ubuntu 10.4 doesn't start on boot

I'm trying to have postgresql 8.4 start on boot on Ubuntu server 10.04 (64bit). First, I tried putting: su -c 'pg_ctl start -D /home/postgres -l /home/postgres/serverlog' --preserve-environment ...
vivri's user avatar
  • 203
5 votes
1 answer
10k views

Where can I find a PHP-FPM RC script?

I compiled PHP on my own computer, and I want to know how to setup a script to start PHP-FPM automatically. Can anyone suggest a script that will do this for me? I'm using a Ubuntu Linux server ...
Mark Tomlin's user avatar
5 votes
3 answers
11k views

Linux's /etc/init.d - symlink, hard link, or actual file?

I have a Debian and an RPM package that requires a start/stop script to be added to the /etc/init.d directory. Recently, I was informed by a remote developer that "those in the know" know that "best ...
user2569618's user avatar
5 votes
2 answers
3k views

Debian init script from scratch

I am trying to write an init script for the SCST iSCSI target software for Debian / Ubuntu. The current one in the download does not work and seems to be outfitted to work on SuSE and others. This ...
AtomicPorkchop's user avatar
5 votes
3 answers
19k views

How can I adapt this debian init.d script to work with CentOS 5?

I'm trying to get an lsyncd daemon running. I installed the lsyncd RPM from epel, but it doesn't seem to come with an init.d script. In the lsyncd repository, there's this script that works with ...
Jason Baker's user avatar
  • 1,219
5 votes
1 answer
6k views

startpar process left hanging when starting processes from rc.local or init.d

I have a peculiar issue when starting ongoing(service-like) processes from either full blown init.d script (SysV style) or a simple one-line call from rc.local file like so: su someuser -c "/home/...
Ivan Kovacevic's user avatar
5 votes
3 answers
30k views

Restart Apache and Kill All Sub Processes

I am trying to restart Apache on my server but it does not seem to kill all the processes that Apache is currently running. The command I am using is sudo /etc/init.d/apache2 restart Is there ...
Josh Pennington's user avatar
5 votes
1 answer
18k views

How to restart postgresql 8.4 on Debian Squeeze when there are no clusters defined?

How to restart postgresql 8.4 on Debian Squeeze? /etc/init.d/postgresql stop/start/restart does nothing (no output given).
Daniil Ryzhkov's user avatar
5 votes
0 answers
3k views

How to set TeamCity Command Line Runner default shell?

I'm starting my TeamCity agent on Ubuntu 15.10 via an init.d script like so: #!/bin/sh ### BEGIN INIT INFO # Provides: TeamCity Build Agent # Required-Start: $remote_fs $syslog # Required-...
Mario Tacke's user avatar
4 votes
3 answers
3k views

s6 : how to get a run script running only once?

I'm using s6 (http://skarnet.org/software/s6/) in order to supervise multiple processes. I have couple services in my /etc/s6/ folder and one of them just need to call the start action from an init.d ...
ZedTuX's user avatar
  • 201
4 votes
2 answers
246 views

How does the operating system know which parameter to pass to /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? How does the os know which ...
iDev247's user avatar
  • 751
4 votes
2 answers
4k views

Ubuntu server not booting due to (possible) disk mounting problems

I have a server running Ubuntu 14.04, with one hard disk partitioned like: sda sda1 -> / sda2 -> /var sda3 -> (swap) sda4 -> /home Whenever I boot, I get the message The disk drive ...
Rohan Prabhu's user avatar
4 votes
2 answers
219 views

What happens to a daemon without a "K" link in /etc/rcX.d/

What happens to processes started by init through an init script, if that script does not have a corresponding K entry in (for example) /etc/rc0.d/? For example, the following script started a ...
fukawi2's user avatar
  • 5,436
4 votes
1 answer
6k views

Restarting Puma using init.d

I have Puma installed and running as a web server for a production Rails site, using Nginx as a reverse proxy. I want to use init.d to manage the services for both Nginx and Puma. It appears to me ...
Turgs's user avatar
  • 285
4 votes
3 answers
7k views

drbd service not startable / WFConnection

I recently migrated my drbd setup from Ubutnu to centos 7 and i get a wierd error: i can load and unload the module normally, and the whole thing seems to work #>modprobe drbd #>lsmod | grep ...
billdoor's user avatar
  • 173
4 votes
2 answers
4k views

Init script & the green [ OK ]

I am trying to install fast-cgi for nginx on an EC2 instance. I followed the steps explained here, but that is meant for Debian and does not work out of the box for a red-hat based system. I modified ...
Lord Loh.'s user avatar
  • 1,079

1
2 3 4 5 6