Questions tagged [init.d]
The init.d directory contains a number of start/stop scripts for various services on a Linux system.
290
questions
0
votes
1
answer
106
views
application runs from command line, but cannot start as init.d script - openWrt
Got a problem with my service written in C. It runs as an init.d service and has been working fine for many months on many devices. Today I've made some changes in the software and very strange thing ...
0
votes
0
answers
433
views
Oracle 19c on Oracle Linux 8, dbora start script ONLY starting when chkconfig sets it to level S99. Any other level like S98, fails to start on reboot
I'm running Oracle 19c on Oracle Linux 8, dbora start script ONLY starting when chkconfig sets it to level S99. Any other level like S98, fails to start on reboot. Regardless of the chkconfig level, ...
1
vote
1
answer
579
views
start-stop-daemon: command not found . This error only occurs at boot time in a cron job
I have scheduled an @reboot cron job to start a service in /etc/init.d
After boot, service is not started when I reach shell command line. The contents of /var/log/cron show the following,
2022-09-...
0
votes
2
answers
2k
views
Monit restart process behavior
Monit's documentation states the following for the restart action :
RESTART restarts the service and send an alert. Restart is performed
by calling the service's registered restart method or by first ...
3
votes
1
answer
17k
views
systemd failing enable with "service is transient or generated". What's wrong with this configuration?
In General
I've been scouring the web looking for actually helpful documentation about systemd and this error, but the majority of it has been troubleshooting niche cases or goes into such extreme ...
0
votes
1
answer
312
views
Create init.d Apache service for multiple instances on debian
I am trying to install a second instance of apache on debian. I used the multiple instance script. during the installation it says:
root@nextcloudpi:/usr/share/doc/apache2/examples# sudo sh setup-...
0
votes
1
answer
171
views
type -p java does not work in a init.d script
I am trying to modify /etc/init.d/jenkins script, in order to add my custom java path. My solutions is this:
JAVAPATH=$(type -p java)
PATH=/bin:/usr/bin:/sbin:/usr/sbin:$JAVAPATH
However, when I ...
1
vote
0
answers
530
views
init.d and remote files systems
The Linux Standard Base Core Specification, 22.4. Installation and Removal of Init Scripts says:
An init script shall be installed in /etc/init.d (which may be a
symbolic link to another location), ...
0
votes
1
answer
137
views
init.d kills my mongod process due to respawning
I'm using Ansible to start the mongod service on a Centos 6.8 VM.
The task is pretty straightforward:
- name: Start mongod service
service:
state: started
name: mongod
However the service ...
0
votes
0
answers
583
views
How do I get init.d to respawn a crashed process if the lock file exists?
I'm running a mongod process on my Centos 6.8 box, and I want to provide some level of resilience in the event of process death.
So I created an entry in my /etc/inittab -
md:2345:respawn:/usr/bin/...
0
votes
0
answers
812
views
Tomcat does not shut down correctly with init.d script on system-shutdown - restart prevented
I want to start Apache Tomcat 7 on my Redhat 7 server (RHEL7) automatically at system startup.
In order to do that, I did the following steps:
creation of the following init.d script and make it ...
0
votes
1
answer
148
views
S6 - slow startup service incorrectly starts second time
I'm using s6 (http://skarnet.org/software/s6/) in order to supervise processes.
I have this working well for hundreds of processes across dozens of docker instances and servers. I have a new problem ...
1
vote
1
answer
297
views
Does running cron by itself have the same behavior as via the init.d script?
I'm working with some code that fires up cron on a server (which doesn't have it running at boot time). The script which starts cron sets up some logging stuff and then simply invokes cron. It doesn't ...
3
votes
1
answer
7k
views
Create a custom /etc/init.d script in Debian 10 Buster
I need to develop an /etc/init.d script to start and stop a server (binary executable) in Debian 10 Buster. Whereas in earlier versions of Debian, you would write a complete shell script that issues ...
2
votes
1
answer
14k
views
Where should init scripts be placed in Amazon Linux 2?
In the Amazon Linux 2 release notes, Amazon advises that initscripts should no longer exist in /etc/init.d
Amazon Linux 2 uses the systemd 219 init system to bootstrap userspace and manage system ...
0
votes
0
answers
1k
views
Running td-agent (fluentd) init.d script under Supervisor got (spawn error)
I have installed td-agent and they provide an init.d script that you can run it with, I have configured td-agent and I run it via the init.d script and it's running smoothly, but I want to move td-...
2
votes
0
answers
2k
views
How do I increase open file limit for nginx's master process on Ubuntu 14.04 LTS?
Not a dupe: This is not a duplicate of this question. I've already looked into that question. That helps with raising the limit for worker processes, but the nginx master process continues to retain ...
0
votes
1
answer
3k
views
Creating /etc/init.d startup script
I have simple /etc/init.d/myscript startup script in my Debian squeeze that just logs to file:
echo "starting init.d script" >> /opt/aaa/starting.log
I did all actions to register script:
...
0
votes
1
answer
310
views
Run php script artisan opcache:optimize after php7.2-fpm start or restart
I want to run
php /path/to/artisan opcache:optimize
to build laravel cache after php7.2-fpm start or after restart.
I have tried to insert it on /etc/init.d/php7.2-fpm in do_start() method but ...
0
votes
1
answer
241
views
linux, daemon startup, determine if launched by initd or user
in my /etc/init.d/blabla script, which is the correct way to determine if the system is booting or the user root is runnig the script ?
I am thinking about
* parent pid
* euid
* terminal... pts ?
0
votes
1
answer
9k
views
Postgresql wont start anymore
Debian 9.5 - postgresql cluster 9.4. It's not a fresh installation - it was a perfectly decently running system, until I tried restarting the service
all commands: /etc/init.d/postgresql start and ...
0
votes
1
answer
581
views
Amazon Linux 17.09 init.d script not starting when Docker does
I'm probably missing something really silly, but does anyone know why this init script isn't running when Docker starts on Amazon Linux 17.09?
#!/bin/sh
### BEGIN INIT INFO
# Provides: ...
4
votes
1
answer
6k
views
Restarting Puma using init.d
I have Puma installed and running as a web server for a production Rails site, using Nginx as a reverse proxy.
I want to use init.d to manage the services for both Nginx and Puma. It appears to me ...
4
votes
0
answers
3k
views
Postgresql fails to start with no such file or directory error?
I was juggling Postgresql versions and I think I shot myself in the foot during the renaming of something. I have 9.3 and 9.4 installed on an Ubuntu 14.04 station, and I wanted to go back to 9.3 so I ...
2
votes
1
answer
183
views
Are these two commands to kill a process effectively similar?
I'm looking at some init.d scripts, and a number of them use this what is essentially this command in their "stop)" target:
kill $(pidof ${DAEMON_NAME})
The pidof ${DAEMON_NAME} is actually a script ...
0
votes
2
answers
1k
views
`pidof` check on host fails when docker container runs same app (e.g. apache2)
The apache2 init script does a pidof check to detect if apache is already running.
if pidof $DAEMON > /dev/null 2>&1 ; then
if [ -e $PIDFILE ] && pidof $DAEMON | tr '...
1
vote
2
answers
5k
views
init script for zookeeper
i have seen that the developers of zookeeper have a great zkServer.sh script to start,stop, restart etc zookeeper, but i have no idea why in the world they decided to skip init script to use.
With ...
1
vote
1
answer
767
views
Does systemd allow for functionality like authbind? Where you can allow a non-root user to bind to a priv port?
Does systemd allow for functionality like authbind? Where you can allow a non-root user to bind to a priv port?
I looked through the manpage and did quite a bit of googling, couldn't find an answer. ...
4
votes
1
answer
2k
views
Is there a way to control filesystem access with systemd?
So I'm diving into the intricacies of systemd and it's ability to meter resources with cgroups like cpu, io, and memory.
Is there also a way to control the directories a process has access to with ...
2
votes
2
answers
8k
views
missing start-stop-deamon on centos 6.8
I am trying to run node_exporter for prometheus on centos 6.8. Here is the init.d script I was able to create:
#!/bin/sh
### BEGIN INIT INFO
# Provides: Node exporter
# Required-Start: ...
0
votes
1
answer
739
views
Init scripts and shutdown order in centos
My current issue is that I have a process hanging from supervisord that I want to make sure it gracefully sending network exists etc.., but by the time supervisor is brought down there is no network. ...
5
votes
0
answers
3k
views
How to set TeamCity Command Line Runner default shell?
I'm starting my TeamCity agent on Ubuntu 15.10 via an init.d script like so:
#!/bin/sh
### BEGIN INIT INFO
# Provides: TeamCity Build Agent
# Required-Start: $remote_fs $syslog
# Required-...
1
vote
1
answer
3k
views
systemctl unable to start red5 init.d script on ubuntu 16.04
I tried to build and install systemd script for red5-server on ubuntu 16.04 server.
I found the sample init.d script at https://gist.github.com/akarambir/a40163f163ae8b131be8 and downloaded
I named ...
1
vote
0
answers
753
views
Debian 8/init.d: start daemon after "$named" is ready
I am trying to start a init.d daemon on Debian 8 after network and DNS is up and running. That's the script I am using:
### BEGIN INIT INFO
# Provides: local_daemon
# Required-Start: $all ...
1
vote
2
answers
2k
views
Systemd PHP start script Centos 7
I have a PHP script I'm trying to create a service for. I've created the service however I can't get it to start. The weird thing is, the exact same service UNIT works on my other server of the same ...
0
votes
1
answer
2k
views
Ubuntu insserv rejected the script header
I m constantly getting this error while I m trying to install or purge any packages -
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
The ...
0
votes
1
answer
859
views
CentOS 7 Converting multiple process init script to systemd service
I have an init script as you see below
#!/bin/bash
# description: connect start | stop | restart | install
# processname: tomcat
# chkconfig: 234 99 01
JAVA_HOME=/
export JAVA_HOME
PATH=$JAVA_HOME/...
3
votes
1
answer
3k
views
openvpn post-up script fails with “Operation not permitted” if and only if openvpn is run by systemd
I have this post-up script that is run by openvpn:
#!/bin/bash
echo "I am: `whoami`"
echo "Moving interface into the netns"
ip link set dev "$1" up netns hydrogenvpn mtu "$2"
echo "Listing"
ip netns ...
1
vote
0
answers
31
views
Start script are not cleared table of processes
I have a proxy server, all ok. But, i have some problems & questions.
First: when i make "/etc/init.d/nginx stop" or "/etc/init.d/nginx restart", of my config, it not reload and all nginx process ...
1
vote
0
answers
531
views
Nginx at startup does not have fd limit set in /etc/security/limits.conf
I have the following configuration for increasing the number of file descriptors available to processes of all users.
cat /etc/security/limits.conf
* hard nofile 65536
* soft nofile 65536
When the ...
0
votes
2
answers
6k
views
How to make ip route settings persistent in CentOS?
I need to route the outgoing traffic via a virtual ip address. I can do this using the 'ip' tool from the iproute-package.
Using ip route I can see which address is used as the source and I can ...
0
votes
1
answer
1k
views
Ubuntu 16.04, PHP-FPM times out at boot with libsodium-php module
The Issue (Modified: with REPRO STEPS!)
To repro, spin up a new VPS with Ubuntu 16.04 (probably works with any Debian distro, but not tested) and follow these instructions:
Through experimentation I ...
6
votes
2
answers
8k
views
Parse error in sudoers file
I've created a user called kafka to whom I am trying to give a sudo access to run only /etc/init.d/kafka commands.
I added the following entry to /etc/sudoers.d/kafka via Ansible:
kafka ALL = ...
6
votes
2
answers
23k
views
Start PHP-FPM with root option automatically
I was trying to get PHP-FPM running a pool as root, but I can't seem to adjust the init.d startup params.
It works when starting PHP-FPM from the CLI (with sudo php-fpm7.0 -DRy /etc/php/7.0/fpm/php-...
60
votes
6
answers
106k
views
"reboot" or "shutdown -r now": what restart command is safer?
We have in our organization around ~500 RedHat Linux machines.
On all the machines we installed applications and services under /etc/init.d, and oracle RAC servers. We intend to perform yum updates ...
2
votes
2
answers
9k
views
Ansible cannot check service status and restart it
I am new in ansible. Now I try to restart my Tomcat service. It looks like ansible cannot detect service status (started/stopped) and cannot (re)start it. Please tell how to do diagnostic?
See here (...
0
votes
1
answer
57
views
Which ssh starup script is invoked by ubuntu?
I am trying to run two sshd processes, one for admin and one for sftp. Ubuntu 14.04 on digital ocean has both upstart in '/etc/init/ssh' and init.d in '/etc/init.d/ssh`.
Is this just digitalocean or ...
0
votes
2
answers
2k
views
Troubleshoot if /etc/init.d script would run on startup, without actually rebooting?
I have this script in /etc/init.d that I want to know if it will be run when the system reboots. Is there a way to "simulate" the conditions of a reboot to see if the script will actually be invoked (...
2
votes
0
answers
2k
views
Running an init.d startup script as a non-root user (PostgreSQL-related)
I am currently installing PostgreSQL from source on a RHEL6 system. I have generally been following the official documentation for guidance (http://www.postgresql.org/docs/9.4/static/installation....
1
vote
0
answers
919
views
Writing custom init script for supervisord
I am using supervisord to control my processes on Amazon Linux. I want to make use of supervisorctl inside my init script. I have the following so far.
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# ...