The init.d directory contains a number of start/stop scripts for various services on a Linux system.
Questions tagged [init.d]
352 questions
493
votes
23 answers
How to run a shell script at startup
On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my Node.js application). I use these scripts to manually start and stop my Node.js application. So far so…

meetamit
- 24,727
- 9
- 57
- 68
214
votes
20 answers
Spring Boot application as a Service
How to configure nicely Spring Boot application packaged as executable jar as a Service in the Linux system? Is this recommended approach, or should I convert this app to war and install it into Tomcat?
Currently, I can run Spring boot application…

MariuszS
- 30,646
- 12
- 114
- 155
142
votes
8 answers
Best practice to run Linux service as a different user
Services default to starting as root at boot time on my RHEL box. If I recall correctly, the same is true for other Linux distros which use the init scripts in /etc/init.d.
What do you think is the best way to instead have the processes run as a…

James Brady
- 27,032
- 8
- 51
- 59
127
votes
12 answers
How can I log the stdout of a process started by start-stop-daemon?
I am using an init script to run a simple process, which is started with:
start-stop-daemon --start --quiet --chuid $DAEMONUSER \
--make-pidfile --pidfile $PIDFILE --background \
--exec $DAEMON $DAEMON_ARGS
The process called…

joeytwiddle
- 29,306
- 13
- 121
- 110
52
votes
2 answers
What is start-stop-daemon in linux scripting?
What is start-stop-daemon and how should it be used?
I am trying to automate a particular program to run. Whenever the system starts, the program should run. For that I am writing script in /etc/init.d/ location.

Rajeev Das
- 1,581
- 4
- 18
- 21
27
votes
4 answers
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 consider the following Perl script (called…

tony
- 618
- 1
- 6
- 12
22
votes
7 answers
nginx not starting after server reboot
I've moved from a built-from-src nginx 1.2.6 installation to 1.4.1 on Ubuntu 13.04.
Installed via Ubuntu PPA, http://wiki.nginx.org/Install#Ubuntu_PPA. This all worked great.
Manually, I can reload/start/stop the service using
sudo service nginx…

Geuis
- 41,122
- 56
- 157
- 219
17
votes
2 answers
How can I set environment variables in my Linux service for Asterisk even though it doesn't have a real user?
I have created a linux service that runs as a deamon (and gets started from /etc/init.d/X). I need to set some environment variables that can be accessed by the application.
Here's the scenario. The application is a bunch of Perl AGI scripts that…

domino
- 2,137
- 1
- 22
- 30
15
votes
7 answers
Nginx daemon stop is failing
I've got Ubuntu 11.04 i386 server with nginx 1.0.11 installed. Also, I'm using this init.d script, the only one I've found in several different places. It starts the server nicely, however, on stop/reset it says
* Stopping Nginx Server... …

Hubert OG
- 19,314
- 7
- 45
- 73
14
votes
3 answers
How to automatically start Kafka upon system startup in Ubuntu?
Does Kafka have an official way (e.g. an init.d script) to start Kafka on system start up?
The only official method to start Kafka I have seen is:
nohup ~/kafka/bin/kafka-server-start.sh ~/kafka/config/server.properties > ~/kafka/kafka.log 2>&1 &
I…

Greg
- 8,175
- 16
- 72
- 125
14
votes
6 answers
Docker.io init.d script not working on start container
I've a container with odoo on it on the dir "/opt/odoo/".
A init script on "/etc/init.d/odoo-server"
#!/bin/bash
### BEGIN INIT INFO
# Provides: odoo
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
#…

Mariano DAngelo
- 920
- 5
- 18
- 39
14
votes
3 answers
How to start a Node.js app on system boot?
I'm working on a Raspberry Pi running Raspbian running a Node.js app and trying to get it to start when the Pi boots. I found a couple of examples but I can't seem to get it working. My current code is:
#! /bin/sh
# /etc/init.d/MyApp
### BEGIN…

user2650875
- 165
- 1
- 1
- 6
13
votes
1 answer
Syntax error: EOF in backquote substitution
I'm getting an error Syntax error: EOF in backquote substitution and I don't have the faintest idea why. Would anyone mind taking a quick look?
#! /bin/sh
# chkconfig 345 85 60
# description: startup script for produtcrawler-router
# processname:…

Kit Sunde
- 35,972
- 25
- 125
- 179
12
votes
4 answers
Using ec2-init scripts with Ubuntu on EC2 - Automatically set hostname and register with Route53
I'd really like to be able to use the ec2-init scripts to do some housekeeping when I spin up an instance. Ideally I'd like to be able to pass user data to set the hostname and run a couple of initialization scripts (to configure puppet etc.).
I…

sgargan
- 12,208
- 9
- 32
- 38
10
votes
1 answer
God won't register a running custom service
I've got a rails website and a small minecraft server running on a linode vps. I'm running minecraft as a custom service off of a ram server based on an init.d file. Since I'm using God to monitor my rails website I thought I'd use it for minecraft…

chrisk
- 235
- 3
- 6