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

learn more… | top users | synonyms

1
vote
1answer
242 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
567 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 ...
5
votes
2answers
28k 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
674 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
613 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 ...
1
vote
1answer
949 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
5k 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
689 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
329 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
346 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 ...
1
vote
2answers
8k 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
974 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
763 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
5k 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
10k 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 ...
3
votes
1answer
622 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
84 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
8k 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 ...
25
votes
2answers
108k 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
8k 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
345 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 ...
9
votes
1answer
4k 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
612 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
347 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 ...
13
votes
5answers
20k 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 ...
17
votes
8answers
19k 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
17k 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 ...
6
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
6k 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 ...
65
votes
3answers
33k views

What is the difference between /etc/init/ and /etc/init.d/?

What is the difference between /etc/init/ and /etc/init.d/? More generally, what meaning does the ".d" suffix convey to a directory?
29
votes
5answers
39k views

Command to list services that start on startup?

Is there a command to list services that run on startup? I imagine it would involve parsing /etc/init.d/, and the various /etc/rc.* directories.