sysvinit

Stop not called for init rc.d service

Stop not called for init rc.d service I have a very simple SysVinit service in /etc/rc.d: #!/bin/bash PIDFILE="/var/run/test.pid" status() { if [ -f "$PIDFILE" ]; then echo ‘Service running’ return 1 fi return 0 } start() { if [ -f "$PIDFILE" ] && kill -0 "$(cat "$PIDFILE")"; then echo ‘Service already running’ return 1 fi …

Total answers: 1

Where is `service status service-name` getting the log print outs from?

Where is `service status service-name` getting the log print outs from? with sudo service ssh status we get an output of logs, such as Jul 16 07:35:50 Linux sshd[1426235]: Disconnected from invalid user root 111.111.111.111 port 59242 [preauth] Jul 16 07:38:50 Linux sshd[1429104]: User root not allowed because account is locked I’m having a hard …

Total answers: 1

Where is fsck run?

Where is fsck run? I was reading through all the things that are run during bootup and have seen that after mounting the rootfs, /sbin/fsck.ext4 is run and after that systemd is run. I was wondering where or how fsck is run, because I was searching for it in the kernel source code and couldn’t …

Total answers: 2

init service failing to enable once a systemd service file is generated

init service failing to enable once a systemd service file is generated I’ve been troubleshooting an issue with a sysVinit service not coming online properly at boot within a systemd environment. What I’ve found is that when no service file or overrides are present in /etc/systemd/system/ for the said service, it autostarts properly. In this …

Total answers: 2

Confused about /etc/init.d vs. /lib/systemd/system services

Confused about /etc/init.d vs. /lib/systemd/system services I am trying to run MongoDB on a Debian 8.5 machine. When I installed the package (pre-built from percona.com), I noticed the following files: /etc/init.d/mongod (1) /lib/systemd/system/mongod.service (2) I understand that /etc/init.d/mongod is called at boot, or in other particular system states, as long as it is registered via …

Total answers: 1

Understanding the linux boot order in /etc/init.d

Understanding the linux boot order in /etc/init.d This question is about Debian, but I guess it’s the same in many linux environments. The /etc/init.d directory defines the services that run at boot-time. As I see it, there are two mechanisms that define who runs and when: runlevel directories – The /etc/rcN.d/ directories, in which there …

Total answers: 1

How does systemd use /etc/init.d scripts?

How does systemd use /etc/init.d scripts? I just switched to debian jessie, and most things run okay, including my graphical display manager wdm. The thing is, I just don’t understand how this works. Obviously my /etc/init.d/wdm script is called, because when I put an early exit in there, wdm is not started. But when I …

Total answers: 2

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

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 running in the system and just ten files. So what is their …

Total answers: 1

How to change systemd service timeout value?

How to change systemd service timeout value? In the company I am working now there is a legacy service and its init script is using old SysvInit, but is running over systemd (CentOS 7). Because there’s a lot of computation, this service takes around 70 seconds to finish. I didn’t configure any timeout for systemd, …

Total answers: 4

How to change systemd service timeout value?

How to change systemd service timeout value? In the company I am working now there is a legacy service and its init script is using old SysvInit, but is running over systemd (CentOS 7). Because there’s a lot of computation, this service takes around 70 seconds to finish. I didn’t configure any timeout for systemd, …

Total answers: 4

Completely remove remains of sysvinit

Completely remove remains of sysvinit As opposed to people who want to get rid of systemd, I want to completely and safely remove sysvinit. I’ve been using Debian since Debian 7.0 (Wheezy). Currently I’m using Debian 9.0 (Stretch). During one of the system upgrades there was move from sysvinit to systemd. systemd works fine for …

Total answers: 1

Systemd and process spawning: child processes are killed when main process exits

Systemd and process spawning: child processes are killed when main process exits Don’t normally post here but I am ripping my hair out over this one. I have a Python script that forks when it launches, and is responsible for starting a bunch of other processes. This script used to be launched at startup via …

Total answers: 3

How to find out if a system uses SysV, Upstart or Systemd initsystem

How to find out if a system uses SysV, Upstart or Systemd initsystem Is there a simple way to find out which initsystem is being used e.g by a recent Debian wheezy or Fedora system? I’m aware that Fedora 21 uses systemd initsystem but that is because I read that and because all relevant scripts/symlinks …

Total answers: 5

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

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 by hs.chandra) is some what simpler, by simply going into crontab -e and …

Total answers: 3

start-stop-daemon won't start my Python script as service

start-stop-daemon won't start my Python script as service I am trying to run Google AppEngine on my Debian machine, I created a file init.d/gae: . /lib/lsb/init-functions # # Initialize variables # name=gae user=$name pid=/var/run/$name.pid prog=”python /opt/google_appengine/dev_appserver.py –host=0.0.0.0 –admin_host=0.0.0.0 –php_executable_path=/usr/bin/php-cgi /var/www” case “${1}” in start) echo “Starting…Google App Engine” start-stop-daemon –start –make-pidfile –background –oknodo –user “$user” …

Total answers: 2

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

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, including /sbin/init). I had no issues to create initrd and populate …

Total answers: 1

Migrate socat init script to systemd

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” [ ! -f /etc/default/socat.conf ] || . /etc/default/socat.conf . /lib/lsb/init-functions PATH=/bin:/usr/bin:/sbin:/usr/sbin [ -x $DAEMON ] || exit 0 # # Try to increase the # of …

Total answers: 2

Convenient way to check if system is using systemd or sysvinit in BASH?

Convenient way to check if system is using systemd or sysvinit in BASH? I am defining common bash files which I want to use across different distributions. I need a way to check if system is using systemd or sysvinit (/etc/init.d/). I need this so I run appropriate command to start the service. What would …

Total answers: 1