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

learn more… | top users | synonyms

0
votes
1answer
811 views

Upstart output pre-start script content

Based on the content of the Ubuntu init.d script to control nginx instances, found at : http://wiki.nginx.org/Nginx-init-ubuntu I'm trying to update Upstart version, found at: ...
1
vote
2answers
974 views

Run script before shutdown/restart

I'd like to run a PHP script when an instance is told to shutdown, but of course before it actually finishes shutting down. My particular script is just looking to push some log files from the local ...
6
votes
2answers
2k 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 ...
4
votes
1answer
593 views

Disable colour output from /etc/init.d scripts?

On RedHat/CentOS systems, all of the service management scripts in /etc/init.d (and also run by the "service" command) produce color output. (i.e. the "[ OK ]" and "[FAILED]" strings.) How do I ...
3
votes
2answers
145 views

Is it possible to set an Upstart service to stop $LAST

I'm wanting the rsyslog service to run until the last moment to ensure we receive as much logging as possible on our central logging servers. On Ubuntu 11.04, rsyslog's stop line is set to "stop on ...
1
vote
2answers
1k views

Reorder the way in which scripts are run at startup

I just moved to debian squeeze and need to change the startup sequence of some scripts. I used to do this with update-rc.d service defaulta xx xx but now with the LSB way of doing things the ...
0
votes
1answer
1k views

I can't get Postgres configured correctly

I have spent quite a bit of time wrestling with this postgresql update, but I just can't quite get it configured correctly. I recently upgraded from 9.0 to 9.1, and I can't get Postgres 9.1 configured ...
1
vote
2answers
140 views

Suppress startup status message in mongod

I'm setting up mongod to run in an /etc/init.d script. This may be a nitpick, but is there a way to avoid this? # service mongod start Starting mongod: forked process: 19820 all output going to ...
8
votes
2answers
9k 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 ...
4
votes
1answer
413 views

Managing services started on boot (rc0.d, rc1.d, etc)

What is the best way of managing which services start when? service --status-all lists all services, but does a poor job of the service status (most are "unknown") and does not provide any method of ...
2
votes
1answer
286 views

Chandler Start-Up Script /bin/bash vs /bin/sh

Have a Chandler install that worked fine for a number of months, but recently when I went to connect to the server, I noticed it wasn't running. SSHing in, confirmed it isn't running, so I go to ...
0
votes
1answer
145 views

/etc/init.d/functions weirdness

OS: fedora 15. seems something has gone awry inside my /etc/init.d/functions file. i can still stop/start/restart services and daemons using /etc/init.d/restart, but the output is no longer showing ...
1
vote
1answer
257 views

Does STDERR go to syslog in an LSB init script?

I am running a Debian system and have an init script in /etc/init.d/ that starts a daemon using start-stop-daemon: start-stop-daemon --start --quiet --pidfile /tmp/myproject.pid --exec ...
4
votes
2answers
1k 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 ...
0
votes
2answers
783 views

Commands /etc/init/boot.local get started before some environment variables get initialized

I have OpenSuse 11.4. I start some on-boot scripts inside /etc/init/boot.local. Where could I move those scripts so that they would be started after all (most) environment variables got initialized? ...
8
votes
5answers
7k 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 ...
1
vote
1answer
145 views

Considerations for building SysV or Upstart compatible Bash scripts

I've just knocked out a quick script for keeping a slave web server in sync with a master using rsync. (https://github.com/simonjgreen/liveFolderSync/blob/master/liveFolderSync.sh) I'd like to make ...
2
votes
1answer
795 views

mongoDB - Linux Service Startup/Shutdown is Failing (possible unclean shutdown)

Linux administration isn't my thing so I'm a bit over my head here. System information: /proc/version -> Linux version 2.6.18-028stab091.2 /etc/debian_version -> 5.0.8 Whenever the server is ...
1
vote
2answers
164 views

init.d service died

Adapting some code from a linux forum, I've added a service script to /etc/init.d on my ubuntu natty server to start/stop/restart node.js It literally was working the first day I made it, but then ...
1
vote
2answers
1k views

Ubuntu Server 10.04 autossh script in etc/init.d

I currently have a script in /etc/init.d which calls autossh with port forward to set up reverse ssh on the server. The command is preceded by 'sleep 20' to try to ensure the command is called after ...
1
vote
2answers
880 views

On RHEL 5.6 I have an init.d script which is stuck in an infinite loop. How to boot without loading it?

I made a bone-headed mistake in one of my init.d scripts which gets stuck in an infinite loop during the boot process and blocks the completion. I therefore can not get to a shell and fix it. How ...
2
votes
2answers
1k views

Ubuntu/Linux: how are startup parameters typically defined for startup scripts (sysvinit)?

I'm curious as to what's the standard method of telling a startup script to execute with certain parameters. For instance with MySQL, there's my.cnf, and from what I can tell, the startup parameters ...
2
votes
2answers
663 views

Proper Bash Daemon Script Creation

On Ubuntu, I copied /etc/init.d/skeleton as a new file and made it "all" executable (just like the others in that directory). In it, I made a "foo" that was just another Bash script in /usr/sbin, but ...
2
votes
2answers
4k views

/etc/rc.local not being run on Ubuntu Desktop Install

I have been trying to get sphinx to run at boot, so I added some lines to /etc/rc.local but nothing happens when I start up. If i run it manually it works however. /etc/init.d/rc.local start works ...
0
votes
1answer
584 views

init.d scripts not executed upon startup

I have a strange problem on an OpenSuSE11.1 box. Only very few of the init.d scripts for runlevel 3 and 5 are executed, eg. syslog and network. Despite the fact all links in the rcS.d folders are ...
3
votes
3answers
903 views

init.d script not starting on startup

I have what I consider to be a pretty simple script that I want to run on startup, however I'm pretty new to init.d scripts, and maybe there is a better way to do this in general. Basically I want my ...
2
votes
2answers
4k views

RH/CentOS service & chkconfig equivalents in Ubuntu/Debian

In RedHat/CentOS distros, you start and stop services with /sbin/service: /sbin/service httpd reload You set whether they should run on startup with /sbin/chkconfig: /sbin/chkconfig --levels 2345 ...
1
vote
1answer
458 views

Question regarding Linux LSB init script directives

I'm making some init scripts to start some system services that require other services to have started in order to start successfully. For instance, one service requires that xenstored be running ...
1
vote
2answers
1k views

Is LSB's init script function “start_daemon” really used for real daemons or should I stick to start-stop-daemon?

In the context of init scripts, according to the LSB specification, "Each conforming init script shall execute the commands in the file /lib/lsb/init-function", which then defines a couple of ...
2
votes
1answer
5k 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 ...
6
votes
1answer
5k 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 ...
1
vote
1answer
220 views

What's wrong in this “test -f” bash script that prevents dkimproxy from starting?

I was trying to configure dkimproxy on my server, after having used dkfilter for long time with success. The reason why I chose to "upgrade" is that DKIM protocol seems to be better supported than ...
0
votes
1answer
124 views

Bind will not run at start up

I have the named script in init.d and a symbolic link in all of the rc#.d directories. I can manually run the script and the symbolic links and named will start just fine. I added "touch ...
1
vote
1answer
875 views

How to unmount LVM automatically at shutdown (Debian/Ubuntu)?

I've created an LVM2 script in /etc/init.d/lvm2 and registered it with update-rc for startup, now the manuals I am reading states "immediately after all filesystems were unmounted:" that this should ...
1
vote
2answers
2k views

What is the proper setup for “anacron”? (Ubuntu 9.10, 10.04)

I am running Ubuntu 9.10 and 10.04 on MediaTemple (ve) servers. On both of them, the anacron setup is broken, ... and they have been broken since I first installed Ubuntu. It has only come to my ...
1
vote
1answer
399 views

Permission denied message when starting gfs2

Can anyone please explain why I get this permission denied error? I try starting the script and it fails with a permission denied message. So I create a copy of it and run that instead and that works. ...
1
vote
2answers
263 views

Run init.d script in the context of the current user session

I'd like to run a script in init.d (on Fedora) in the context of the user session I'm logging in as. I have a script called keyboard_deadkeys I wrote to set some deadkeys on my keyboard. The ...
2
votes
3answers
3k views

Comprehensive guide to init.d scripts?

I'm looking for good resources to learn more about how to write/debug/maintain init.d scripts on Ubuntu. Do you have any links or books to recommend ?
8
votes
4answers
1k views

init.d scripts written in Python

A question came up on SO 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 Python: Bad. ...
2
votes
1answer
5k 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 ...
0
votes
1answer
987 views

Ubuntu 64bit Xen DomU Issues after upgrade from Karmic to Lucid

I was upgrading my servers today and it all went fine except the last machine which has the following issues: [Resolved using ...
3
votes
1answer
232 views

Problem with startup script

I am trying to get Chandler running on a debian box on startup under user 'chandler', and have tried the following script, locating it in init.d: #! /bin/sh # # /etc/init.d/chandler # RETVAL=$? ...
5
votes
4answers
1k 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 ...
0
votes
3answers
406 views

fedora 13 init.d script, can’t stop

I wrote init.d script that suppose to run java CLI proccess. The problem is that when i stop it, i get [failed] and the proccess is still running. thanks #!/usr/bin/env bash # # chkconfig: 345 ...
1
vote
2answers
2k 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 ...
2
votes
1answer
369 views

My init.d script is never called with the stop parameter?

I created a script called blueBoxT for starting and stopping Oracle and placed it in the /etc/init.d directory. #!/bin/bash echo "blueBoxT $1 - `date '+%Y%m%d%H%M'`" >> /root/blueBoxT.log case ...
1
vote
3answers
2k views

How to activate eth0 / eth1 earlier in ubuntu boot process

Let's see if I can explain this right: I have servers with two ethernet interfaces - one external and one internal facing. I have a DB (pg) on one server and accessible from other machines on the ...
16
votes
4answers
14k 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 ...
3
votes
1answer
547 views

Script in /etc/init.d won't run on startup (Ubuntu 8.10)

I'm on Ubuntu 8.10 The script runs when called from the command line with sudo /etc/init.d/xbindkeys start. Here's how it looks: #! /bin/sh ...
0
votes
2answers
511 views

Ubuntu SSLH Service Not Starting on Boot

I am trying to run SSH and HTTPS both on Port 443 on an Ubuntu server. I found SSLH which seems to do the trick. My only problem is getting it to start on system boot. Supposedly, it is already setup ...