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

learn more… | top users | synonyms

1
vote
1answer
853 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 ...
10
votes
1answer
355 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 ...
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 ...
0
votes
0answers
40 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 ...
2
votes
0answers
58 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
941 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 ...
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
28 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 ...
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 ...
0
votes
1answer
27 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
16 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
122 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
24k 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
52 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 ...
12
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
33 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
48 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
33k 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 ...
11
votes
4answers
6k 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
36 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
299 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
361 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
29 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
49 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
32 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
22 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
59 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
29 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
88 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
118 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
93 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
144 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,...
75
votes
1answer
123k 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
604 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
57 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
15 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
170 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
38 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-...
3
votes
1answer
160 views

How to debug systemd “init” freeze during boot?

I'm trying to get my own init script running on some ARM hardware and Debian Jessie with systemd. The overall boot concept and init script is almost identical to a x86 variant, which works fine. For ...
7
votes
3answers
19k views

Running a script during booting/startup; init.d vs cron @reboot

I am currently trying to understand the difference between init.d and cron @reboot for running a script at startup/booting of the system. The use of @reboot (this method was mentioned in this forum ...
0
votes
1answer
308 views

Requiring a script to sync ramdisk before and after reboot

On a specific machine I use a lot of RAM to serve websites really fast directly from RAM (which by the way is working amazingly well). For this I have mounted a ramdisk in /etc/fstab (in debian 7, via ...
1
vote
1answer
29 views

Does metainit have a directive to generate a log file?

Does metainit have a directive to generate a log file by redirecting process's standard output stream to it? The naive way of: Exec: /srv/wordy/wordy >/var/log/wordy.log does not seem to work ...
1
vote
0answers
177 views

ifplugd(lo): Program execution failed, return value is 1

I have a Raspberry Pi running Raspbian, and I see this error when initializing ifplugd. ifplugd(lo): Program execution failed, return value is 1. From judging the log section, it seems to end where ...
0
votes
1answer
123 views

Init script for a daemon to run screens on CentOS

I have a question concerning a init.d script. Currently I have a init script that launches a custom daemon as follows: sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" & ...