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

learn more… | top users | synonyms

1
vote
1answer
1k views

Default-Start contains no runlevels

I am trying to make my custom made daemon run at startup and when I call update-rc.d ydcd enable I get the error update-rc.d: using dependency based boot sequencing update-rc.d: error: MyDaemon ...
3
votes
1answer
112 views

unable to install anything using apt-get because of insserv

Whenever I try to install something using apt-get I get the error messages involving insserv. I have tried install many different packages but everything give same error. And apparently, CUPS package ...
1
vote
1answer
2k views

Linux Mint: How to enable 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 ...
1
vote
0answers
14 views

Why start script and kill script does not appear in pairs in rcX.d folder?

The scripts need to be executed at boot time was put in the /etc/init.d,and files contained in /etc/rc*.d was the symbolic links point to files in /etc/init.d.Furthermore the names of the symbolic ...
2
votes
4answers
231 views

Executing programs without having to specify a directory?

Why is it that I have to type /etc/init.d/apache2 (args) in order to run apache?? Isn't there a way to just apache2 args ??
1
vote
1answer
990 views

Kernel logs on power failure

I was wondering if it was possible to have a logging program document a random power failure. Clearly it won't have any time to log when the power fails, but is there a way to recognize a power ...
1
vote
0answers
21 views

Execute file at /init before /sbin/init without an initial filesystem

Whenever Linux is booted using an initialramfs/initrd, it executes a file on the temporary filesystem at the path of /init before mounting the real filesystem and executing whatever is specified in ...
2
votes
1answer
27 views

Writing daemon, /etc/rc.d/init.d/functions hangs

I am writing my own service daemon for Fedora 23 and I stucked, when my script hangs while including source function library. #!/bin/sh # # service-live-text-relation <summary> # # chkconfig: ...
9
votes
2answers
38k 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, ...
0
votes
1answer
106 views

Debian 8.1 with Uboot bootloader cannot run FSCK on reboot

I am running Debian 8.1 on an SD card on a Banana PI with U-boot bootloader. I'm trying to force my system to run fsck on reboot, but no matter what I do, nothing happens. Here are what I have tried ...
1
vote
1answer
1k views

How can I kill child processes with start-stop-daemon?

I'm writing a simple web server using nc and bash. It looks like this: #!/bin/bash rm -f /var/run/streamman/out mkfifo /var/run/streamman/out trap "rm -f /var/run/streamman/out" EXIT while true do ...
10
votes
1answer
373 views

What is the meaning/purpose of *.pid files in /var/run

I'm quite new in Linux world, and now I'm trying to understand FHS principles. In /var/run I found about ten *.pid files like crond.pid which contain just PIDs. There are more than ten processes ...
0
votes
0answers
45 views

Linux + how to shutdown application properly with reboot or init 0 + init.d scripts

I have Linux Redhat (version 6.5) machine that manages some application before each reboot or init 0 I shutdown the application as the follows: /etc/app-LM.bash /etc/app-UPP.pl /bin/DT-apl.c ...
5
votes
3answers
4k 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
0answers
30 views

How does one run Multiple parallel Tomcat instances in CentOS 6?

I can install them to different directories, and I think I can make them use different ports, as well. I'm going to add 10000 to each port number for the second installation, and 20000 to the third ...
0
votes
1answer
36 views

Systemd pause boot while script runs

I have a script that I want to run at boot, and whilst it runs I would like it to pause the boot process. I have tried the systemd service [Unit] Description=setup script Before=default.target [...
2
votes
4answers
2k 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 group-...
2
votes
1answer
17 views

Update on reboot with init.d

I created a script to add a bunch of packages and update the system on a fresh install. Here's the relevant part of my init.d script that is giving me trouble: #!/bin/sh ### BEGIN INIT INFO # ...
5
votes
1answer
2k views

Watchdog daemon doesn't start at boot

I'm using a Raspberry Pi B, with Raspbian. After upgrading to Jessie, watchdog daemon doesn't start at boot anymore. Starting it manually using "sudo service watchdog start" does work. I tried: ...
2
votes
1answer
139 views

Unable to start ZNC as a service

Firstly, this is the exact same question as found here, but the given solutions did not work in my situation. Background I am running a CentOS 6 VPS and I want to run a ZNC bouncer on it. I ...
5
votes
3answers
13k 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 ...
11
votes
3answers
25k views

The rc0.d,rc1.d,… directories in /etc

I'm running Ubuntu where I have the directories /etc/rc0.d, /etc/rc1.d, /etc/rc2.d, ..., /etc/rc6.d. Example files from my machine: directory example symlinks in the dir ------------------------...
0
votes
1answer
70 views

Configuring Systemd to execute extra script after httpd start/restart using ExecStartPost setting not working

I need to have a PHP file execute whenever the httpd service starts or restarts. I found that Systemd has a configuration setting called **ExecStartPost, which looks perfect for what I need to do. I ...
13
votes
2answers
18k 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 ...
0
votes
0answers
39 views

Unknown job error on running service

I am getting an 'start: Unknown job: elasticsearch' error when I try to do service elasticsearch start When I run service --status-all I can see elasticsearch present in the list. But I ...
1
vote
1answer
69 views

How can I run my jar file in the background [closed]

I have developed a quick HttpHandler java application (jar file) and I now need it to run. Basically my jar act as a web server and I need it to be running while my linux machine is on. How can I ...
10
votes
7answers
34k 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 ...
12
votes
4answers
7k 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 ...
1
vote
1answer
47 views

start-stop-daemon always returns '0' although the process fails

I am trying to get an init script running that starts nodejs as a daemon. The problem is, that when I executing start-stop-daemon it always returns '0', regardless of what error the nodejs-daemon may ...
0
votes
1answer
358 views

noip2 can't update my IP address correctly after computer reboot

I want to set up a server with using no-ip DDNS service. I follow this guide, but it can't update my IP address after reboot the following message is command # noip2 -S 1 noip2 process active. ...
3
votes
1answer
466 views

systemd: running a script on shutdown after filesystems are mounted read-only

Is there a way to run a script on shutdown, after the file system is remounted as read-only? I've a raspberry pi connected to a wireless socket, which I can control via a sender and a script. I want ...
0
votes
2answers
32 views

Best way to start multiple “screen” scripts after restart? (centos)

We are using centos. As soon as the server is restarted and the OS is fully loaded, we would like to have a certain user ("foo") start three or four scripts with screen. For example, screen -d -m -S ...
0
votes
0answers
14 views

referencing init script from custom location for Running it as a linux daemon

I am installing a software in a RedHat or SUSE Linux system. The whole software belongs to a specific user. From my basic knowledge on linux systems for installing any script as a linux daemon you ...
3
votes
1answer
61 views

Trying to create a service but it won't start

Apologies if this is an obvious answer, I am a Windows admin professionally and only use Linux in my homelab to try to learn new things - so I'm very inexperienced with Linux. I am working on writing ...
0
votes
0answers
41 views

How to add squashfs file to linux live iso with initrd and mount it

I'm looking for a way I can add files to linux live iso that I've built and somehow load them to memory after or before initrd loads and then mount them as tmpfs, Anyone know how to do that? Thanks.
0
votes
1answer
23 views

Running code before initrd has been removed and after the root filesystem has been mounted

I looked here Kernel boot process and I tried to understand how to run a script before initrd filesystem removed and but after the root filesystem has been mounted (EncFS), If I understand it ...
0
votes
1answer
60 views

Simple manager for systemd

Is there a manager that would run in the console, similar to sysv-rc-conf, that works with the latest systemd under Linux? Ideally it would be able to operate on all runlevels, and be ncurses based.
1
vote
1answer
33 views

Busybox ASH inside initrd has a problem when piping tee to sed

I'm trying to log the early boot output from the init script. This is what is working: mkdir -p /run/log && \ mkdir -p /tmp && \ mkfifo /tmp/stage-1-init.log.fifo1 && \ mkfifo ...
0
votes
1answer
112 views

Do I need set ulimit for system services, such as nginx.service(systemd)/nginx(sysv)?

I know, when we run application in shell for a large website, we'd better set ulimit for our shell, But most of the service is started by systemd/sysv. Do I need set the ulimit in the service ...
1
vote
2answers
158 views

Real world use of suckless's “sinit” init [closed]

I'm trying to set sinit as an init for linux (on a pc..). My goal at moment is simply running a single tty/bash from it. No special mounting is required as the kernel already gets a root=/dev/sda2 for ...
0
votes
0answers
110 views

Bash script is not executing after reboot command Ubuntu 14.04

I've tried using a /etc/init.d/ script, an upstart script, crontab, etc. None of the above are causing the script to execute on boot. The service I am attempting to automatically start on boot is ...
0
votes
3answers
199 views

Startup script needs root permissions

I have a script that I need to run at startup. I have it in init.d. I need to execute one of the commands within the script with root permissions. How do I go about doing this? Edit 1: For reference,...
80
votes
1answer
130k 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
2answers
1k views

Debian autossh boot script not working properly

I wrote the start script at the bottom of this question to try to get one of my devices to automatically create several remote forwarded ports with my VPS upon boot. (I've stripped the LSB tags to ...
1
vote
1answer
655 views

status_of_proc does not find the process

I am trying to make an init script to work as expected, the start / stop functionalities works flawlessly, but I cannot get the status function to work as expected. I am running : Distributor ID: ...
0
votes
1answer
69 views

Execute a init script from C++ program

I have a script in my /etc/init.d/ which executes an application. I am able to start,stop and get status of the service from terminal. Now I would like to start the same service from my C++ program. ...
0
votes
0answers
16 views

inittab entries without runlevels

Refering to here 1 ap::sysinit:/sbin/autopush -f /etc/iu.ap 2 ap::sysinit:/sbin/soconfig -f /etc/sock2path 3 fs::sysinit:/sbin/rcS sysinit >/dev/msglog 2<>/dev/msglog </dev/console 4 is:...
1
vote
1answer
6k views

Init script to run a script as specific user

/apps/data/service/bin/startup.sh This is the script i want to be executed during RHEL booting. I want it to be run in runlevel 3 only. And i want this script to be started as specific user, eg:...
2
votes
1answer
204 views

Explanation of systemd startup

Raspbian Jessie uses systemd and most system startup processes seem to be run from .service files. There are still a lot of SysV init entries. I gather from reading various articles that Debian 8 has ...
0
votes
0answers
41 views

dracut run hook after root is mounted

I want to run a hook after the root block device is mounted. I'm not sure what I need to do in my module-setup.sh script to get my script to run and run in the right order. I was using the dmsquash-...