The init.d directory contains a number of start/stop scripts for various services on a Linux system.
Questions tagged [init.d]
352 questions
5
votes
1 answer
Why do many init.d scripts end in "exit $?"?
I've seen a lot of strange quirks in CentOS 6.5's init.d scripts, but one pattern I've seen at the end of most of these scripts is
case "$1" in
# ... commands here
esac
exit $?
What is the purpose of "exit $?" here?

Score_Under
- 1,189
- 10
- 20
5
votes
1 answer
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
- 990
- 7
- 12
5
votes
2 answers
Puppet init script doesn't create the pid file?
CentOS release 5.4 (Final)
puppet-server-2.7.19-1.el5 is installed from the puppetlabs repo.
puppetmaster is started successfull, but it doesn't create the pid file. It is the reason for [ FAILED ] message when stopping:
/etc/init.d/puppetmaster…

quanta
- 3,960
- 4
- 40
- 75
4
votes
0 answers
paramiko and nohup ''
OK so I have paramiko v2.2.1 and I am trying to login to a machine and restart a service. Inside the service scripts it basically starts a process via nohup. However if I allow paramiko to disconnect as soon as it is done the process started…

othane
- 558
- 5
- 15
4
votes
1 answer
Get service name in init.d
I'm trying to find out which is the name of the service script that is running at startup. I need the name for calling the default script afterwards.
I can't assume the name in advance, that's why I have to get it during its…

RicardoPB
- 61
- 3
4
votes
2 answers
How do I translate init.d scripts from Ubuntu/Debian Linux to Solaris?
I have several init.d scripts that I'm using to start some daemons. Most of these scripts I've found on the internet and they all use start-stop-daemon. My understanding is that "start-stop-daemon" is a command that is specific to Linux or BSD…

Dave Jensen
- 4,574
- 1
- 40
- 45
4
votes
2 answers
insserv: missing `Required-Stop:' entry: please add even if empty
In the /etc/init.d/myservice script i have the following lines
### BEGIN INIT INFO
# Provides: myserviced
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description:
#…

Talespin_Kit
- 20,830
- 29
- 89
- 135
4
votes
1 answer
Golang exec: stat: no such file or directory after file has been moved there
I have a script that I am using for deployment using the "os/exec" package. One of the commands that I use is as follows:
cpInit = exec.Command("cp", "initScripts/nginx", "/etc/init.d/nginx")
and another:
startNginx =…

Charlie Andrews
- 1,457
- 19
- 28
4
votes
2 answers
Executing python script in background in init.d
to interact with my iPhone, i have created a python script that sends and recives data through a socket, the script must be started after emule in order to work,
i have thought of something like…

PirosB3
- 1,961
- 1
- 17
- 21
4
votes
3 answers
How to run ruby via sudo
Hi I am creating a new init script for monitoring a ruby program .
NAME=differ
FILE_PATH=/home/amer/Documents/ruby_projects/differ/
PIDFILE=/home/amer/pid/differ.pid
PID=$$
EXEC='/home/amer/.rvm/rubies/ruby-2.0.0-p247/bin/ruby…

Amerrnath
- 2,227
- 4
- 22
- 33
4
votes
1 answer
Is there a way to know where init scripts in Linux are stored?
As I asked in the title, I'm looking for a script/command to find the correct directory (usually /etc/init.d or /etc/rc.d/init.d).
Right now I'm using
dirname `find / -name acpid 2> /dev/null | grep /etc/`
but sometimes I get more than one…

l3golas
- 107
- 9
4
votes
1 answer
Running Apache Archiva standalone in Gentoo?
I have a server running Gentoo 2.6.12 r6 and I want to run Apache Archiva as a standalone server at startup. Does anyone have a working init.d script to accomplish this? Thanks!

JavadocMD
- 4,397
- 2
- 25
- 23
3
votes
1 answer
Init.d script for nginx on Cent OS
I'm using the init.d script from this: http://wiki.nginx.org/RedHatNginxInitScript but this script sucks on my CentOS 5.5 nginx 1.0.6 (which installed by passenger).
It sucks for 2 reasons:
When I run service nginx start, it start nginx but then do…

Phương Nguyễn
- 8,747
- 15
- 62
- 96
3
votes
0 answers
init.d script for Mojolicious app using Carton
I have a Mojolicious app that I would like to run automatically when the server starts. Normally, if I want to deploy the application, I use carton install to grab the appropriate dependencies, then I run carton exec -- hypnotoad script/myapp and…

Ryan Dunphy
- 792
- 2
- 10
- 33
3
votes
2 answers
Spring Boot JAR not executing as an init.d service
I have created a Spring Boot application with the following build.gradle file (Gradle version 5.4.1):
plugins {
id 'org.springframework.boot' version '2.1.6.RELEASE'
id 'java'
}
apply plugin: 'io.spring.dependency-management'
group =…

Akshay Singh
- 93
- 10