Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [init.d]

The init.d directory contains a number of start/stop scripts for various services on a Linux system.

Filter by
Sorted by
Tagged with
0 votes
0 answers
99 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 ...
user avatar
  • 91
2 votes
1 answer
7k 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 ...
user avatar
  • 21
0 votes
1 answer
132 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-...
user avatar
0 votes
1 answer
76 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 ...
user avatar
0 votes
0 answers
241 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), ...
user avatar
  • 229
0 votes
1 answer
102 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 ...
user avatar
0 votes
0 answers
222 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/...
user avatar
0 votes
0 answers
431 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 ...
user avatar
0 votes
1 answer
75 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 ...
user avatar
  • 121
1 vote
1 answer
191 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 ...
user avatar
  • 2,322
2 votes
1 answer
6k 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 ...
user avatar
  • 75
2 votes
1 answer
9k 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 ...
user avatar
  • 1,269
0 votes
0 answers
685 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-...
user avatar
2 votes
0 answers
949 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 ...
user avatar
  • 1,933
0 votes
1 answer
2k 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: ...
user avatar
  • 99
0 votes
1 answer
195 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 ...
user avatar
0 votes
1 answer
162 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 ?
user avatar
  • 263
0 votes
1 answer
7k 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 ...
user avatar
  • 165
0 votes
1 answer
405 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: ...
user avatar
4 votes
1 answer
5k 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 ...
user avatar
  • 275
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 ...
user avatar
2 votes
1 answer
149 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 ...
user avatar
  • 1,264
0 votes
2 answers
805 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 '...
user avatar
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 ...
user avatar
  • 481
1 vote
1 answer
631 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. ...
user avatar
4 votes
1 answer
934 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 ...
user avatar
2 votes
2 answers
7k 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: ...
user avatar
0 votes
1 answer
641 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. ...
user avatar
5 votes
0 answers
2k 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-...
user avatar
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 ...
user avatar
  • 522
1 vote
0 answers
512 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 ...
user avatar
1 vote
2 answers
1k 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 ...
user avatar
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 ...
user avatar
0 votes
1 answer
731 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/...
user avatar
2 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 ...
user avatar
1 vote
0 answers
27 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 ...
user avatar
1 vote
0 answers
479 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 ...
user avatar
0 votes
2 answers
5k 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 ...
user avatar
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 ...
user avatar
6 votes
2 answers
7k 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 = ...
user avatar
  • 2,915
6 votes
2 answers
19k 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-...
user avatar
58 votes
6 answers
90k 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 ...
user avatar
  • 1,001
2 votes
2 answers
8k 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 (...
user avatar
0 votes
1 answer
54 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 ...
user avatar
  • 183
0 votes
2 answers
1k 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 (...
user avatar
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....
user avatar
  • 21
1 vote
0 answers
611 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 # # ...
user avatar
  • 153
1 vote
1 answer
190 views

Run command in screen when LSB initscript stopped

I'm trying to get a Bukkit server to run inside a screen as a service, started from an LSB script but I cant get it to stop correctly. What I essentially want it to do is reattach the screen and send ...
user avatar
  • 11
1 vote
2 answers
1k views

Running a service as root in RHEL 6

I am trying to force Kibana to listen on port 80 therefore it needs to run as root. How can I do this? The init script is as follows: #!/bin/sh # Init script for kibana # Maintained by # Generated by ...
user avatar
4 votes
0 answers
609 views

redis-server2 is start-stop-daemon: warning: this system is not able to track process names longer than 15 characters

So I've had the need of running 2 instances of redis in the same server. My server is an Ubuntu 14.04 box. So I followed this guide, but not in a strict way. I mean, instead of modifying redis init ...
user avatar

1
2 3 4 5 6