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

learn more… | top users | synonyms

10
votes
3answers
1k views

Replacing my firewall rules

I've had an init script for many years that configures iptables for me and it has worked like a champ until now. After upgrading from 10.04 to 12.04 I started having firewall problems where the ...
2
votes
1answer
2k views

specify user for init.d

I have a init.d script that start|stops|restarts a daemon using the start-stop-daemon. This daemon is always started as root. I want to be able to specify the user that the init.d script will use to ...
0
votes
1answer
1k views

Unable to restart SSH daemon: Missing init script

When I try to restart the ssh server I get the following output: bash: /etc/init.d/ssh: no such file or directory
6
votes
1answer
4k views

How do I configure Apache to run multiple instances?

Specifically, I have two httpd.conf files: /etc/apache2/httpd.conf /etc/apache2/httpd_2.conf How should I modify the /etc/init.d/apache2 script so that instances of Apache will be invoked for both ...
5
votes
1answer
3k views

SABnzbdplus will not start on boot but running the init.d script runs fine

I am running the Ubuntu 12.04 server edition (static LAN IP) and was tying to install SABnzbdplus using the apt as per instructions here: Ubuntu PPA Repository Installation has gone smoothly and the ...
6
votes
1answer
5k views

How to start / stop Dropbox at a specific time

I have setup a service on my Ubuntu 10.04.4 LTS server, which works when started and stopped manually using sudo service <service> start etc. However I would like to have the service (dropbox ...
1
vote
1answer
4k views

Start-up problems - some daemons not starting

This is a new installation of 12.04 and I can see that my machine is using both the old sysvinit method and the new upstart method to launch programs on start-up. According to the man page for ...
0
votes
2answers
322 views

Can't run init script on boot after another init script

I have three init scripts and the Broker init script runs fine, but when I try to run the Consumer init script and then the Data Collector init script, the only process that is running is the Broker. ...
0
votes
1answer
2k views

Boot order of MySQL

I have a conflict with two programs in Ubuntu 10.04. I have configured an init.d file that boots up a program. However, this program requires MySQL to be running before it starts. When I boot the ...
2
votes
1answer
314 views

How to auto-install runlevel control for existing service/daemon?

Need to install a service/daemon (in this case bind9, a DNS service) runlevel control, aka "rc" control (/etc/rc*.d and such). bind9 came pre-installed on my 11.04 system, but without aforementioned ...
5
votes
2answers
5k views

How can I run an application in gnome-terminal automatically when booting?

I need to run an application automatically when Ubuntu starts. I've got this app running without opening the terminal. However, this application displays some information in a terminal window and, ...
0
votes
1answer
4k views

vncserver in rc.local will not run at boot

I'm using /etc/rc.local and here is the current contents: Okay, for some reason the formatting here isn't making a codeblock and instead is making everything bold and 3x the size. Those who are able, ...
0
votes
2answers
3k views

What startup system does ubuntu use?

i've seen several ways to add programs or daemons to startup in Ubuntu 12.04 but I am kind of perturbed with the meaning of each method, basically because i dont understand the underlying startup ...
26
votes
15answers
49k views

Can't start mysql - mysql respawning too fast, stopped

Today I did a fresh install of ubuntu 12.04 and went about setting up my local development environment. I installed mysql and edited /etc/mysql/my.cnf to optimise InnoDB but when I try to restart ...
1
vote
1answer
272 views

/etc/init.d Character Encoding Issue

I have a script in /etc/init.d on an EC2 image that, on machine startup, pulls in source code via SVN, builds it, and then runs it using Ant. The source code is Java. Within this code is a call to the ...
0
votes
1answer
603 views

Alternative way to start mysql server other than upstart?

I have a chrooted 10.04 LTS installation on a NAS, it works great but breaks Upstart very badly. MySQL only works via Upstart these days, so I created a workaround to start like this: dtach -n ...
6
votes
3answers
30k views

How to create init.d startup script

I just want to run a very simple command on startup. How can I do that? I've searched google and it has very complicated examples, but what I need is just run this script on startup. How can I do ...
2
votes
2answers
837 views

Init.d script gets return code 1 when calling itself, how can I get output?

My question is, how can I modify the script so that it will tell me what goes wrong? The scenario is this: I'm trying to get Sonatype Nexus to start as a service in Ubuntu 10.04, and it just will ...
1
vote
1answer
683 views

Customizing upstart “restart” commands

I'd like to run a different command when upstart is restarting a process than when it is starting a process. In particular, I'm using Thin and I want to do a rolling restart (built in to thin via a ...
1
vote
2answers
2k views

What is start_daemon?

I'm trying to understand start_daemon in the following /etc/init.d/nagios-nrpe-server startup script: start) if [ "$INETD" = 1 ]; then exit 1 fi ...
2
votes
1answer
1k views

Managing dependency across Upstart and SysV-style init.d script

I have an Upstart job that must run before a SysV-style init.d script runs. The init.d script is configured to be started in the runlevels 2, 3, 4 and 5 with priority 20. What can I do to have the ...
2
votes
2answers
6k views

How to Automatically run two commands after login?

I have these two commands that I need to manually run every time after login: autossh -M 2000 -N -f -q -D 127.0.0.1:7070 user@domain.com and sudo mkdir /media/C sudo mount /dev/sda2 /media/C I'd ...
0
votes
1answer
733 views

Upstart Jobs and init.d scripts not launching

I'm working on an Ubuntu based browser distro that is meant to be ran live. Part of the security solution is to use sdmem when it shuts down. sdmem wipes the available ram and is found in the ...
2
votes
3answers
393 views

How to disable mysqld in 10.04?

I have a few (Linode) Ubuntu 10.04 (64bit) VPSes, and mysqld keeps starting on every reboot on all of them -- $ uptime 16:32:26 up 1 min, 1 user, load average: 0.09, 0.08, 0.07 $ ps -ef | grep -i ...
2
votes
0answers
399 views

Backup on shutdown [closed]

I am developing a system that runs an rsync every 15 min using cron. It rsync's the users directory to a local backup on another device. I'd like to also run the rsync on shutdown or reboot. How do ...
7
votes
0answers
16k views

What's the “right way” to restart services in 11.10? [duplicate]

I have a stack of things I used to do when my wireless was spazzing out (which it seems to do from time to time), including running sudo /etc/init.d/networking restart but lately I'm getting this when ...
3
votes
2answers
12k views

How to make a script in init.d run later

A package installed /etc/init.d/ccpd which is a script run at start up. I would like this script to be run as very last of all my start up scripts, how can I achieve this?
1
vote
1answer
2k views

How do I get Upstart to start my Mediatomb service?

I've been struggling, trying to get my Mediatomb server to start automatically on Upstart run level 2. I can't figure it out. I guess Upstart is still new to me and I don't understand it. I even ...
3
votes
1answer
1k views

On 10.04 Lucid, how can I add a script to startup to run as another user?

On 10.04 Lucid, how can I add a script to run at startup as another user? Will I add a script someplace like /etc/init.d/myscript ? Or is it better to put it in the cron file for root as @reboot and ...
1
vote
2answers
770 views

Where do I put my start up script for mysql?

I have created a second instance of MySQL on the server for replication, if I start the process manually it works but need it to start at bootup. I used to just do a bash script in the init.d folder ...
1
vote
2answers
2k views

How do I replace corrupted /etc/inittab and /etc/init.d/rcS files?

I am using Ubuntu 11.10 on my laptop and I have managed to overwrite my /etc/inittab and /etc/init.d/rcS files while running a stupid script with sudo. Can anyone please provide me the default ...
4
votes
1answer
6k views

When you run `update-rc.d myscript default` - what is called on startup/shutdown?

What gets called on startup/shutdown when you run update-rc.d myscript default? Docs seem fuzzy, I want concrete. I am guessing that this happens: At startup (specifically at entry to runlevel 2, ...
2
votes
2answers
12k views

How to write an init script that will execute an existing start script?

I'm trying to understand the init process. I have a script which launches 3 background processes (2 shell scripts and a java app). It works just fine from the command line. I'd like to execute that ...
4
votes
1answer
707 views

Why does $ service --status-all output to STDERR instead of STDIN?

This is very unintuitive. e.g. When a user tries to: # service --status-all | grep postgres This won't work... The only way to grep `service' is: # service --status-all 2>&1 | grep ...
1
vote
1answer
99 views

Prevent new packages from linking start up scripts?

How can i prevent newly installed packages from creating links in e.g /etc/rc2.d? Currently i'm launching update-rc.d -f blabla remove /etc/rc.local each time during boot. But this shouldn't be ...
12
votes
2answers
11k views

How do I set up a service?

I have a script that I would like to run as a service on my Ubuntu Server 11.04 headless box. That is, I want to have the correct files under /etc/init.d/ and to be able to control it via the service ...
30
votes
2answers
147k views

How to start and stop a service? [duplicate]

Possible Duplicate: What’s the recommended way to enable / disable services? Are there any other command to start stop restart service in ubuntu other than the below following. service ...
1
vote
2answers
9k views

update.rc-d init.d startup script is not starting

I got a simple script called hwtestinit which I installed using update-rc.d hwtestinit defaults On the surface, as far as I can inspect, all seems fine , I mean, the following files, all exists, ...
2
votes
1answer
1k views

how to read init.d script start argument

In reference to the following documentation, how can i read the start and stop argument? I want to tell if the computer is booting up or shutting down so that i can run the correct script. To make ...
2
votes
1answer
368 views

Where can I find information or description of the boot up process?

I am looking for links to detailed information on how the ubuntu boot process is managed after grub is finished. I have googled by all the documentation referes to individual packages. (upstart, ...
3
votes
1answer
2k views

Setting the owner of the file created by start-stop-daemon output redirection

I have the following line in do_start() of my custom init script that starts a java application: start-stop-daemon --background --start --quiet --oknodo --make-pidfile --pidfile $PIDFILE --chdir ...
2
votes
2answers
2k views

Custom daemon script: works, but does not run at boot / startup

this is Ubuntu 10.10 Maverick. I have the following shell script in init.d that I want to run as a "daemon" (background service with start/stop/restart really) at system startup. There is a symlink ...
12
votes
1answer
5k views

How do I set which PostgreSQL version is to be used by default?

I have 2 different versions of PostgreSQL installed on my system (Ubuntu Lucid): /var/lib/postgresql/8.4 /var/lib/postgresql/9.0 By default, when I run a PostgreSQL command such as createdb or ...
2
votes
1answer
629 views

Error with APE Server Installation

I was trying to install APE-Server from the .deb file at the ape-server homepage (www.ape-project.org) and I ran into an error so wanted to try removing the installation and reinstalling. I did a ...
3
votes
1answer
372 views

Is init.d “safe” enough to use or should i use `runit` or `daemontools` on a server

I am looking to deploy my application on a server on which I would have no access in the future. I would like to have an indication of start-up errors generated by my program in particular and the ...
16
votes
5answers
31k views

How to correctly add a custom daemon to init.d?

I've got a 3-rd party proprietary application server daemon which can be started and stopped by couple of command lines. I need this daemon to start when the system starts up and correctly stopped on ...
18
votes
9answers
24k views

haproxy doesn't start

Installed a new Ubuntu 10.04 server and logging in as root I installed haproxy using apt-get. I can run haproxy directly as a daemon but when I do /etc/init.d/haproxy start nothing happens.. not even ...
2
votes
5answers
23k views

init.d script startup problems

I Have this init.d script which I am trying to get to startup with ubuntu however it wont run at startup. It does work when i type "sudo /etc/init.d/couchpotato start" though. Any ideas on how to get ...
8
votes
2answers
3k views

Start / stop init.d script without root access

I am setting up an ubuntu-server in order to host the virtuoso server. I want to setup a simple user (without sudo) account that will (only) be able to run /etc/init.d/virtuoso-opensource-6.1 ...
4
votes
3answers
7k views

Don't start Xserver

I'm trying to convince Ubuntu's init system not to start X11 at boot-up. Removing gdm did not change the fact that each time the machine restarts, X11 with Gnome comes up. How do I get rid of it? I ...