The scripts to be executed at boot, usually for starting deamons and mounting file systems.
3
votes
1answer
24 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 ...
1
vote
1answer
22 views
What is the difference between rc, rc.local and rc.sysinit?
I tried to display the list of startup scripts for the current runlevel at bootup. I wrote the following code.
rl=`runlevel | cut -d " " -f2`
ls /etc/rc.d/rc$rl.d/S* | cut -d "/" -f5
sleep 10
It's ...
4
votes
3answers
110 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.
#
...
0
votes
2answers
48 views
how to create php-fastcgi.sock for Nginx
I've installed Debian Wheezy and downgraded php5.4 to php5.3, and wanted to use fastCgi instead of php-fpm since it is not included in php5.3 package.
now I run into a little issue and can't seem to ...
2
votes
3answers
416 views
How do I determine whether my services are using runit or init?
How do I determine whether my services are using runit or init? I use Ubuntu 10.0.4.
Such as nginx, chef, puppet, etc.
0
votes
1answer
562 views
Converting update-rc.d redis_6379 defaults to chkconfig command
I'm trying to run the commmand below to Centos and of course I get command not found. How do I then convert it to chkconfig ?
update-rc.d redis_6379 defaults
0
votes
0answers
43 views
Can not call a command
I have a script /etc/init.d/tilestream with:
TILESTREAM="/usr/bin/tilestream"
MAPPATH="/data"
HOST="host"
#HOST="localhost"
#UIPORT="9001"
UIPORT="8888"
#TILEPORT="9000"
TILEPORT="8888"
...
1
vote
1answer
335 views
Linux Mint: How to enble cryptswap with custom password?
When you want to use hibernation and you care for security, you'd like to have the swap encrypted. But not with the random password, chosen for you at startup, but with a fixed one, supplied by you at ...
8
votes
2answers
5k 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 ...
1
vote
1answer
1k views
hostapd will not start via “service” — but will start directly
I am having trouble getting hostapd to start as a service. It fails when I try to start it:
$ sudo service hostapd start
[FAIL] Starting advanced IEEE 802.11 management: hostapd failed!
From what ...
1
vote
0answers
24 views
Matterhorn dead but PID file exists
Installed opencast-matterhorn14 in a Centos 6.5 Machine and after Installation steps while I try to run the Matterhorn using
service matterhorn start
I keep on getting the same error:
...
0
votes
1answer
36 views
init.d script won't send graphical data
I have a client sever java program. The client's work is to capture the screen and send data to server. An additional function it does is opens the website given from server and send some text to ...
0
votes
1answer
28 views
Should “invoke-rc.d” or “service” be used to restart services?
I'm confused as to which is best and in which circumstances:
invoke-rc.d apache2 restart
or
service apache2 restart
Is there a real difference?
man service has the following interesting bit:
...
0
votes
2answers
244 views
Jboss application startup and shutdown asks for password. How to automate with init script?
Jboss application startup and shutdown of BMC-IDM asks for password (called keystore password, some Java stuff).
How to automate with init script?
Stop application
> stop_idm_suite.sh
Suite ...
1
vote
2answers
47 views
/etc/init.d permissions issue
We are trying to harden our Linux Redhat 5 servers and one of the findings is for the /etc/init.d. The security finding is requiring that we chmod it to 700 or more restrictive. Please see the ...
3
votes
1answer
330 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 ...
4
votes
1answer
87 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 ...
6
votes
5answers
330 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
...
1
vote
1answer
137 views
Migrate socat init script to systemd
I use socat with following init script on debian 7.2 with sysVinit. It works perfectly:
#!/bin/bash
DESC=socat
DAEMON=/usr/bin/socat
LIB=/usr/lib/socat
SOCAT_ARGS="-d -d -lf /var/log/socat.log"
[ ! ...
18
votes
7answers
22k 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
1
vote
2answers
518 views
davmail systemd launcher on headless server
I'm trying to follow the ArchWiki guide for writing a custom service file to launch DavMail as a system-wide daemon. Previously I had a line in my ~/.xinitrc that read
nohup /usr/bin/davmail ...
0
votes
4answers
1k views
add command to /etc/init.d/rc.local file that's missing
Want to add the command
sudo mount -t vboxsf H_DRIVE /media/windows7share
to /etc/init.d/rc.local file, to run the command every time when system starts up but I don't have such a file (rc.local) ...
4
votes
2answers
57 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 ...
2
votes
2answers
2k views
/etc/init.d/script, or /etc/inittab - respawn on die
I have a daemon/service (milter-regex), that is dying. I'm only using it temporarily (A few months), so don't care too much, but I want it to restart when it dies.
It is an init.d script. 'service ...
4
votes
2answers
175 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 ...
1
vote
2answers
174 views
Distro agnostic init script dependencies
I'm trying to write an init script which will be able to handle basic dependencies (for example, It has to be started (just) before MySQL service starts). Is there a distro agnostic way to write such ...
10
votes
1answer
19k 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?
1
vote
1answer
946 views
Upstart documentation for CentOS 6
I am currently migrating from CentOS 5.5 to 6.4. Having fun converting /etc/inittab stuff to upstart. Ran into a lot of little problems but am getting the hang of it now. The best documentation ...
4
votes
2answers
354 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 ...
2
votes
1answer
444 views
How to properly use Gentoo Linux as a supplement to an existing distribution?
While I originally wanted to entirely replace the Linux distribution my NAS uses, I meanwhile came to the conclusion that it would be better to leave the existing system as unmodified as possible and ...
18
votes
1answer
766 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 ...
1
vote
2answers
282 views
An init-script does not get called on shutdown
I have set up an init-script to control the state of a VirtualBox VM:
#!/bin/sh
#chkconfig: 35 99 5
#description: vTiger virtual machine
### BEGIN INIT INFO
# Provides: vtigervm
# Required-Start: ...
0
votes
3answers
113 views
Networking starts up but interface has no IP
I have a box that is supposed to run headless.
When I boot and manually run /etc/init.d/networking everything starts fine.
When I add it to my startup scripts (/etc/rcS.d) as placed by sysv-rc-conf ...
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 ...
2
votes
2answers
75 views
LFSH … what is '/lib/init' for?
I'm trying to understand the init/boot process. My system is LMDE, so I presume it will be pretty much standard Debian in that regard. I believe I more or less understand the basics of the init ...
1
vote
1answer
179 views
How to make some initscript start after delay at boot?
I want to run a thing that may disrupt the system (or remote access to it) if something goes wrong (for example, misconfiguration).
To reduce problems I want to have a "grace period" after the system ...
0
votes
2answers
57 views
Run a single command at the start of the machine
Most unix servers do have services defined as init scripts, on linux in: /etc/init.d and on hp-ux in: /sbin/init.d.
However, what if I just want a single command to be executed when machine boots?
I ...
2
votes
1answer
115 views
local shutdown scripts (do's and don't's)
At work, I'm running linux, and use vagrant on a daily basis. What I find annoying is that the system often hangs when I reboot/shut down, if I forgot to vagrant halt any virtual boxes I may have ...
2
votes
1answer
594 views
chkconfig bootup script failing, script runs good manually
I recently purchased a vps and I attempted to create a startup/restart script to start up my java program. I am running CentOS 6. The script works if I execute it manually with this command:
...
-3
votes
1answer
77 views
where is this HOME environment variable and what do I have to add -H too it?
I recently attempted to run a boot up script which failed I didn't know why it failed so I posted a question about that here.
chkconfig bootup script failing, script runs good manually
Where the ...
2
votes
1answer
100 views
Why is the restart inittab action asking me for an id?
I am following the NAND firmware update tutorial to try to get my system to run from RAM so I can flash it. I previously had my script running but for some reason unknown to me it is giving me:
INIT: ...
4
votes
1answer
84 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>, ...
3
votes
2answers
150 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 ...
2
votes
1answer
609 views
Sabayon - mysql (and other services) won't start
It's a fresh install of Sabayon Linux. I installed mysql (equo install dev-db/mysql), configured it (emerge --config ...), but it doesn't start using /etc/init.d script:
# /etc/init.d/mysql start
* ...
1
vote
3answers
3k views
Difference between /etc/init.d/networking restart and invoke-rc.d networking restart
Is there any real difference between /etc/init.d/networking restart and invoke-rc.d networking restart (Debian)?
1
vote
1answer
337 views
Daemons not starting during the boot on PUIAS (RedHat) 6.4
I am total Linux n00b entrusted with bunch of PUIAS (RedHat) 6.4 servers and desktops. I noticed after rebooting my computing nodes (done just for testing purposes) that many of the daemons which are ...
0
votes
1answer
56 views
Why env variable are not visible while starting a service
I am wondering why during service start up environment variables are not visible. To be more precise: I created service startup scrip according to LSB spec which starts some java process. For this ...
10
votes
3answers
30k 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 ...
3
votes
1answer
369 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
...
2
votes
2answers
3k views
How to make a script run at boot time in Debian Wheezy?
I am writing a script to do some tasks at boot up time in my Debian Wheezy AWS EC2 AMI. Sources on the internet say that usual way to do this is to use update-rc.d to install the symlinks needed to ...