The scripts to be executed at boot, usually for starting deamons and mounting file systems.

learn more… | top users | synonyms

18
votes
7answers
23k views

Create services in Linux (Start up in linux)

I need one process run before log in to system. how to run it like services?(how do I make services in Linux?) in Ubuntu and Fedora ? the service is customized tomcat
18
votes
1answer
836 views

What sets systemd apart from other init systems?

It is not quite official but it looks like systemd is coming to Debian and after reading some of the heated mailing list discussion on that decision, I am curious about the polarizing nature of ...
11
votes
1answer
20k views

How to write startup script for systemd

I have 2 graphics cards on my laptop, one is IGP and another discrete, I've written a shell script to to turn off discrete graphics card. How I can convert it to systemd script, to runt at start-up?
10
votes
3answers
32k views

How can I make a script in /etc/init.d start at boot?

I think I read something a while back about this, but I can't remember how it's done. Essentially, I have a service in /etc/init.d which I'd like to start automatically at boot time. I remember it ...
10
votes
2answers
537 views

Removing abstraction from Ubuntu boot process

I have been using Linux after almost 5 years and observed that boot process has been almost abstracted. I mean, not much is visible to the user what is going on behind the scenes (Due to splash ...
9
votes
3answers
24k views

No such file or directory /etc/init.d/functions

I created a startup script to start/restart/stop a group of applications. I used the lib /etc/init.d/functions in my script. It is working well on my system, but it not working for my client; he is ...
8
votes
2answers
6k views

How to make unix service see environment variables?

I have set my environment variable using /etc/profile: export VAR=/home/userhome Then if I do echo $VAR it shows /home/userhome But when I put reference to this variable into the ...
7
votes
3answers
4k views

/etc/rc.d vs /etc/init.d

Is ubuntu's /etc/init.d directory exactly equivalent (functionally) to what I presume to be the more standard /etc/rc.d/ (at least on arch)? Is there any particular reason canonical used init.d ...
7
votes
3answers
2k views

Why does initramfs mount the root filesystem read-only

What is the reason for the root filesystem being mounted ro in the initramfs (and in initrd). For example the Gentoo initramfs guide mounts the root filesystem with: mount -o ro /dev/sda1 /mnt/root ...
7
votes
1answer
325 views

difference between Fedora's, openSUSE's, and Mandriva's initscripts?

I'm trying to figure out how the init system works for these distributions, but they seem to use different layouts... How do each of them work?
6
votes
5answers
360 views

Removing unused init scripts

On my Debian server, I have no network shares (NFS, SMB, ...). I am trying to optimize and simplify my boot process. Is it OK to remove the following init scripts? /etc/rcS.d/S12mountnfs.sh ...
6
votes
4answers
1k views

Why do I need to hit enter to get my shell prompt after my init.d script completes?

I had to write my own CentOS init.d script for celery because it only ships with one for Debian. You can see the script I wrote when I answered my own stack overflow question 3989656. But there's a ...
6
votes
1answer
3k views

How can I make this daemon/init run as a non root user?

I have an init script to kick off a daemon. The problem is it runs as root. I would like it to run as a user called "deploy". Ubuntu 12.04 #! /bin/sh # File: /etc/init.d/unicorn ### BEGIN INIT ...
5
votes
3answers
7k views

Missing init.d/apache2 file

I am new to linux and just recently messed up my first apache/tomcat configuration. After trying to delete apache and tomcat, and now trying to reinstall apache 2, I am missing the init.d/apache2 file ...
5
votes
3answers
545 views

Aliases for 'sudo /etc/init.d/'

Are there any standards for aliasing sudo /etc/init.d/? I'm sure many people have considered cutting down these 17 characters to just 2 or so.
5
votes
2answers
560 views

What's the difference between /etc/rc.d/rc*.d and /etc/rc*.d

I know that rc*.d directories are used at startup, or reboot, or so on time, for starting or stopping programs. Can anybody explain me what's the difference between the rc*.d folders placed under the ...
5
votes
3answers
7k views

How to run a program on boot up?

So I have this program which I manually run as root : sudo gammu-smsd -c /etc/gammu-smsdrc -d What this does is it runs the Gammu (software to manage gsm modems) and 'daemonize' it. My problem is ...
4
votes
4answers
1k views

What's the connection between “/etc/init.d” and “/etc/rcX.d” directories in Linux?

I am learning command line from a book called "Linux Command Line and Shell Scripting Bible, Second Edition." The book states this: Some Linux implementations contain a table of processes to start ...
4
votes
1answer
108 views

Displaying all sysvinit init scripts

Is there some tool that displays all available init scripts (on Debian), short of one having to remember a location like /etc/init.d, not to mention that not everything in there is an init script?
4
votes
2answers
324 views

Are certain parts of startup scripts necessary or just good practice?

I'm currently exploring creating a startup script in the form of a system process located in the /etc/init.d/ on my Fedora 14 Linux installation. It sounds like the following two lines are bare ...
4
votes
2answers
421 views

Why pidof and pgrep are behaving differently?

I have a init script in /etc/init.d/myservice for initialize a service like this: ... start() { ... daemon /usr/sbin/myservice ... } stop() { ... pgrep myservice pidof myservice ps -ef ...
4
votes
3answers
122 views

Why doesn't rc.local run entirely

Here is my rc.local #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # ...
4
votes
1answer
349 views

inittab '-' character in process field

I have a an inittab file with the following entry: console::askfirst:-/bin/ash According to this Man page a '+' character in the process field means init will not do utmp and wtmp accounting ...
4
votes
2answers
4k views

How to write init.d script log messages to disk?

I'm running Debian wheezy. Many scripts in /etc/init.d/ use various logging functions defined in the Linux Standard Base, like log_success_msg and log_warning_msg. The LSB documentation seems a bit ...
4
votes
1answer
103 views

BASH_ENV and cron jobs

I have several questions related to non-interactive, non-login shells and cron jobs. Q1. I have read that non-interactive, non-login shells only "load" $BASH_ENV. What does this exactly mean? Does ...
4
votes
2answers
59 views

What's the recommended way to run a service as a non-root user?

I have a simple init.d script which starts and stops a process. I call the init.d as root, but I'd like the process it controls to run as a specific user. The most common suggestion online seems to ...
4
votes
1answer
92 views

bash_completion for initscripts

I have writen my own initscript /etc/init.d/myscript. I can start and stop my script with the service command service myscript start service myscript stop When I type service <TAB>, ...
4
votes
2answers
178 views

Is it good practice to create a background job within an init script if the process can not daemonize itself?

I am fairly new to *nix, and have come across the need to drop multiple processes, that should be run 100% of the time. to background using &. I use the following line in an init.d script to do ...
3
votes
3answers
9k views

How to create an unprivileged user in CentOS?

I want to create an unprivileged user to run my RhodeCode server and Celery daemon on a CentOS instance. I think the accepted definition of this is no home directory, login disabled, and no shell ...
3
votes
2answers
159 views

How to make /etc/init.d script act like it's launched under X?

I'm trying to track down some quirkiness with a Java application that misbehaves when launched via a startup script in /etc/init.d , but runs fine when you open a GUI terminal window and run it ...
3
votes
3answers
40 views

possibilty of running deamons with under privilaged users while bootup

I have authoritative DNS daemon in my test DNS setup. which is responsible to provide host IP at best choice. Anyway this daemon/process can run by setting some capabilities using setcap and then a ...
3
votes
1answer
421 views

How to trick an init script into returning 0

I have a init script which is poorly designed because it does not conform to the Linux Standard Base Specifications The following should have an exit code of 0 if running, and 3 if not running ...
3
votes
1answer
339 views

SysV init run levels

On a system that uses SysV init run levels such as Centos 5, when the OS is booting, does it go straight to the run level defined in /etc/inittab? If I change my run level using the init command do ...
3
votes
1answer
203 views

Is there a standard way to configure what policy iptables loads on startup under Debian?

I've just started playing with Debian 6.0 (Squeeze) in a VPS environment, as a way to learn more about system administration. One thing I'd like to configure is a default packet filtering policy. ...
3
votes
2answers
2k views

Run daemon on startup in Fedora 13 after wireless interface is up

I want to have radvd (the IPv6 router advertisement daemon) run on startup on Fedora 13. However, the network interface that it will use must be up, otherwise the daemon won't start. If I run the ...
3
votes
1answer
47 views

Grepping a variable

I've written a simple init script to start and stop a Python script as a service. I have to be explicit about the version of Python I'm running, because this is on a CentOS 5 box with Python 2.4 & ...
3
votes
2answers
145 views

why do I have two different results if I run a program through terminal(as root) or /etc/init.d(or /etc/rc.local)

Background: I use Debian Lenny on an embedded device uname -a Linux device 3.4.0 #83 Sun May 26 17:07:14 CEST 2013 armv4l GNU/Linux I have a C code (say my_C_program) that calls a board specific ...
3
votes
1answer
255 views

Mount /etc from disc into squashfs

I've created a gentoo-live system which should be booted from a CF-card. The whole file-system is in a squashfs. I've created a custom initrd which first mounts the CF-card and from there the squashed ...
3
votes
1answer
37 views

Process management and pkill

I've been studying process management using shell scripts and I'm starting to realise how difficult it is to make sure that it's done right. For example, you can record the PID of a program to a ...
3
votes
1answer
122 views

Flatten shell script (include sourced scripts) and remove unused functions

I am manually tweaking Debian init scripts in order to optimize the boot time of an embedded device. So far I reduced it by half just with the "low hanging fruits" ie. the smaller scripts that are ...
3
votes
2answers
354 views

How to update an init script

What is the proper way to update an init script an ubuntu system? I am trying to upgrade my version of gitlab from 6-0 to 6-1, part of the upgrade consists of replacing the init script. Upgrade ...
3
votes
1answer
4k views

In Debian 6, how to start a daemon as a different user?

I'm trying to start the Tor daemon as another user. When it installs, Tor automatically creates a new user "debian-tor", however, it does not run as this user, but rather as root. In Debain 5 I ...
3
votes
1answer
57 views

Minimal Linux with kernel and BusyBox: /etc/inittab is ignored, only /init is executed

I managed to create a small and fully functional live Linux CD which contains only kernel (compiled with default options) and BusyBox (compiled with default options + static, all applets present, ...
3
votes
1answer
88 views

autostarting scripts in debian

I have a service that I install as so: install -m 755 init_script /etc/init.d/spacenavd cd /etc/rc2.d ln -s ../init.d/spacenavd S99spacenavd what the init_script does is start the script: ...
3
votes
2answers
13k views

How can I run a shell script as a daemon under Redhat?

I've got a shell script, which is essentially a one liner with some logging, which I'm trying to run this from an init script. I'm using the daemon function inside of /etc/init.d/functions to run it, ...
3
votes
2answers
1k views

How to make “notify-send” work from daemon application [duplicate]

Possible Duplicate: Can I launch a graphical program on another user's desktop as root? I wrote a script which starts from init.d .When it finishes I need it to notify-send a message to ...
2
votes
3answers
1k views

How do I set the group (gid) of a process I'm about to launch?

I'm porting a Debian init.d script to CentOS. In the Debian script, it uses start-stop-daemon for launching the process. The script uses start-stop-daemon's --group flag to change to a different ...
2
votes
5answers
5k views

Create directory in /var/run/ at startup

I'm using apache2 and postgres running on Ubuntu Server 10.04. I have removed the startup scripts for both of these apps and I'm using supervisor to monitor and control them. The problem I have run ...
2
votes
1answer
116 views

rc control user

I am playing around with rc scripts. I am starting a daemon from rc.local. I would like to know how I start the process under a specific user instead of root?
2
votes
2answers
808 views

Can readahead-services be safely disabled?

I am just going through the service-list of a server (CentOS 5) - the question will probably apply to other RedHat, Fedora, ... versions, too. Note that my servers normally run in runlevel 3 (no GUI ...