Questions tagged [init-script]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
25 views

init script that run a socket continuously

I run my script(socket) as daemon with init-script : #!/bin/bash ### BEGIN INIT INFO # Provides: sock_serv # Required-Start: $local_fs $syslog $remote_fs # Required-Stop: $...
0
votes
0answers
24 views

What mean the number after S or K in /etc/rc{0-6}.d [duplicate]

I've already know that with an S will be started at the runlevel in question while those whose name begins with K will be killed. But there is some meaning in the number after S or K? one example: /...
1
vote
1answer
71 views

Reading filesystem type at boot into BASH variable

I have a /etc/rc.d/S11 link to a /etc/init.d file that is trying to set a bash variable of the file system type of a given blkid entry. root@OpenWrt:/# blkid /dev/mmcblk1p3 /dev/mmcblk1p3: UUID="...
1
vote
0answers
22 views

Conditionally run command in init.d service script stop() on shutdown/reboot in CentOS6

I have a service script in CentOS 6.10 that needs to touch a file when service myservice stop is called by the user or process, but not when stop() in the script is invoked by shutdown or reboot by ...
0
votes
0answers
12 views

Is there a command named 'run_scripts' in open SUSE for the init daemon?

For a particular init daemon, I've come across a command 'run_scripts' and a directory specified after the 'run_scripts' for the initialization of those daemons. What is it, and why is it used in such ...
0
votes
1answer
39 views

How to make my sysvinit service work on as many distros as possible?

I am attempting to write a cross-platform sysvinit service that works on as many sysvinit systems as possible. Things I need: The process needs to daemonize (it does not automatically daemonize ...
0
votes
1answer
181 views

Linux CentOS: run rc.local after boot

I am running a CentOS (Red Hat Enterprise Linux Server release 7.6 (Maipo)) instance on AWS. I need to add to my boot sequence execution of a rc.local script. How can I do that? I have looked in /ect/...
2
votes
1answer
380 views

/etc/inittab respawn already running process, Debian9

I added an antry in /etc/inittab to respawn a binary. The entry is like: id:2:respawn:/path-to-my-bin I then execute init q and the process is started by inittab. If I kill the process, it's ...
1
vote
1answer
66 views

How to migrate a multi-instance LSB script to systemd?

I wrote an LSB init script that can manage multiple instances of my daemon: rcfoo start starts all the instances (which are found in some /etc configuration file), rcfoo stop stops all the instances, ...
3
votes
2answers
954 views

Start a Qt/wayland application on top of weston on startup

I would like to launch a Qt application on start up. The application uses some of the features from weston/wayland desktop, so it should be launched on top of weston, right after weston is started. ...
0
votes
1answer
49 views

My script not running on start up (linux-lite)

I have script and I want it to run when my system reboot. I put the script in /etc/init.d/superscript and add script to end of the rc.local bash /etc/init.d/superscript # i also test this source /...
0
votes
0answers
10 views

Server mount facility names

I have a service that mounts a server in a folder in /etc/init.d Sometimes it runs when I start the computer, sometimes it doesn't. I think that it depends on the wireless connection. If it is ...
2
votes
0answers
138 views

launch reverse tunnel on init with autossh in the background

I need an init script which will establish a reverse tunnel connection to a server. I've come up with the following start script: #! /bin/sh ### BEGIN INIT INFO ### END INIT INFO case "$1" in ...
1
vote
1answer
317 views

launch reverse tunnel with autossh on bootup in Ubuntu

I would like to launch a ssh reverse tunnel on system launch. The following line let's me establish the tunnel fine - but I end up being logged into server which I don't want, especially not from an ...
1
vote
0answers
52 views

Unable to fully execute the task before Shutdown

I have created the script in /etc/init.d/backup, Its function is to take the backup of all the data which took around 10 -15 minutes. I want to execute at shutdown (runlevel 0) and reboot (runlevel 6)....
1
vote
1answer
621 views

Init scripts invoking script on a user's directory — not working (Ubuntu 18.04)

I want to automatically start email tunnels and socks proxy at boot time. I have an /etc/init.d/email-tunnels script that invokes another script under my home directory. It won't work at boot time, ...
0
votes
1answer
137 views

what dependency-based linux init systems suitable for embedded systems?

Currently, I run Linux on an arm board using Sysvinit, but the network drivers of my board are not the best which causes the network service to stall the boot for a while, I also have problems with ...
3
votes
2answers
134 views

wget saving files as emply plain text files on boot

I have a bash script in crontab that runs @reboot: The script itself contains a wget command to pull and download a file from the internet When I run my script after signing in and opening the ...
1
vote
1answer
184 views

Init startup script ordering

In the /etc/rc5.d directory there are example 2 shells to be executed on boot. S02dbus-1 and S20syslog. From my understanding S02dbus-1 will be executed first. Now if I take a look at the shell script ...
0
votes
1answer
120 views

Init Script not running from PWD

I have installed gunicorn webserver and make gunicorn virtualenv init.d script but when i run service gunicorn start service from my project directory it works well, But when my present working ...
0
votes
0answers
117 views

Trying to create a startup script

I followed this guide to create a startup script that mounts my shared windows folder and starts my VPN. However, the script is still not working on the startup. I am currently using VM VirtualBox to ...
3
votes
0answers
109 views

Execute a command instantly after system is powered

I would like to execute a command instantly after system is powered. My project is realized in an embedded Linux environment (Yocto-based, with U-boot bootloader), therefore I would like to show a ...
6
votes
2answers
1k views

Can I make Qemu exit with failure on kernel panic?

I'm trying to add Qemu to my continuous integration pipeline to test various initrd artifacts. I've already discovered that I can run Qemu like this: qemu-system-x86_64 \ -machine q35 \ -...
0
votes
1answer
1k views

Automatic sudo permissions for startup script

I need to run a script upon startup, which I understand needs to be done in the init.d folder. Now this script requires sudo permissions, it prompts the user for the sudo password when being run ...
1
vote
2answers
798 views

Mounting Encrypted Softraid on OpenBSD

The Setup I have a machine that is running OpenBSD, it has two SSDs in it: sd0 and sd1. I've setup each SSD with two partitions a and d. From there I've built two mirrors using bioctl: The first ...
2
votes
2answers
3k views

systemd failing to recognize pid file

So I am trying to start a service on systemd enabled system. Name of service is ossec-hids-authd which is the authentication engine(agents) in ossec(Intrusion Detection Software). When I go and start ...
2
votes
1answer
4k views

Catch-all command to restart display manager?

Is there a catch-all command to restart display managers (on any given common init system)? I've got systemctl restart display-manager for systemd-based systems currently, but I don't know that that'...
1
vote
0answers
402 views

Changing permissions of /sys/ directory at boot (permanently)

I'm building a system, using buildroot, that will have a webpage to control a raspberry's GPIO pins, using php. To do so, I'm writing (and reading) the kernel files located in /sys/class/gpio/.. the ...
6
votes
1answer
9k views

Can systemctl list all enabled services, including legacy services?

This question asks: "How to list all enabled services from systemctl?" Answers on that page include: systemctl list-unit-files | grep enabled systemctl list-unit-files --state=enabled At least as ...
0
votes
0answers
23 views

Granting service specific capabilities

I have a sm-t365 rooted tablet. I've created a service in the init.rc file that all it does is create a folder in /data (which requires root), it works if in my service in init.rc i specify user root.....
1
vote
1answer
256 views

RHEL /usr/local v.s. /usr on NFS - mount/unmount order?

At least historically, Red Hat wrote In Red Hat Enterprise Linux, the intended use for the /usr/local/ directory is slightly different from that specified by the FHS. The FHS says that /usr/local/ ...
1
vote
0answers
93 views

init system run level services restart after crash?

I've been learning about the run levels of init systems and I understand a service can be set to run at a certain run level so it always starts at that given run level. But what happens if the ...
0
votes
0answers
116 views

CentOS 7 SystemD Script with additional Command [duplicate]

I've created a SystemD Script to manage an application that is set up as follows /usr/lib/systemd/scripts/testsocket start() { // code here } stop() { // code here } restart() { stop ...
3
votes
1answer
2k views

systemd: nginx does not resolve /etc/hosts entries at boot time

Using Debian 9, the behaviour of systemd is the following: At boot-time nginx does not seems to read /etc/hosts and failed to start After boot, when the command systemctl start nginx it is working ...
1
vote
1answer
536 views

systemd: finish the execution of custom shell script before starting nginx

Using Debian 9 stable, I want to start a custom shell script before starting NGINX processes and shorewall firewall: Do some init work Mount a directory (overlayfs) to overlay /etc with NGINX ...
0
votes
1answer
256 views

Weird behavior of configuration in OpenRC init script

I'm trying to make a simple OpenRC init script for a service. What I have so far looks like this: #!/sbin/openrc-run CONFIG=${CONFIG:-/etc/pysystemfan.json} pidfile=${PIDFILE:-/var/run/pysystemfan....
0
votes
1answer
1k views

Startup / shutdown script for RedHat

I'm trying to create startup / shutdown script for my application, but I do not have experience with that, so I wanted to start with screen (I'll refer to it as "test_screen"). Firstly I thought I'll ...
1
vote
1answer
309 views

Writing start script with different working directory

I installed octoprint to my raspberry pi earlier this year in order to control my 3d printers. I've been able to make the pi control 2 printers at once using octoprint. Also I've added a second ...
1
vote
2answers
4k views

What are ways of creating a daemon using systemd? [closed]

I'm not sure what the general methodology of daemonizing a script is. For example, I've searched online and if I was trying to write a python script that checked the time every second on my computer, ...
1
vote
1answer
1k views

Order of execution for cloud-init-local on AWS Linux

I am attempting to create a new EC2 instance and I am supplying user-data to the instance at create time. My user-data executes some bash commands that modify the parameters of a properties file for ...
0
votes
0answers
327 views

Ubuntu startup application with no monitor

I need to start an application on start up in Ubuntu. I have created a script in /etc/init which works fine when a monitor is connected, but if I disconnect the monitor and reboot, the script fails. I ...
0
votes
1answer
946 views

macOS /etc/paths.d [closed]

So, this thread Use `/etc/paths` or `/etc/paths.d` to add items to the PATH in macOS Sierra? discusses /etc/paths and /etc/paths.d briefly in connection with macOS (ne OS X 12, sierra) /usr/libexec/...
1
vote
0answers
351 views

How to stop startup scripts from getting deleted on reboot in ONIE

I'm running an open source "install environment", that acts as an enhanced boot loader utilizing facilities in a Linux/BusyBox environment called Open network install environment (ONIE). I want to run ...
3
votes
1answer
1k views

How does the success fuction on init.d functions of RHEL works?

I am using an Amazon Linux AMI, which is a derivation from RHEL, and it uses SysVint for it's services. I am not an experienced Linux user and I am learning more about services, so I came across the ...
1
vote
0answers
551 views

supervisord as watchdog for various services

I tried to configure supervisord as watchdog for tomcat, redis and some other services. The goal is to automatic restart if the services are crashed or stopped. Here is my configuration for redis and ...
0
votes
1answer
1k views

When running a daemon, how do I execute a command from a given directory?

My shell script knowledge is a little shaky, but I want to run a daemon (Ubuntu 14.04) defined in /etc/init.d/unicorn, like so case "$1" in start) check_config check_app_root ...
0
votes
0answers
290 views

init.d script cannot access alsa audio

I've written a simple init.d script to start an hardware monitor script. It works fine except it cannot access the alsa audio service: #! /bin/sh SCRIPT_PATH="/d/SharedPrograms/hwleds.py" case $1 ...
1
vote
0answers
23 views

SysV start a script using local nvm

I have node installed in the users home directory. I have a program I want started on a headless machine to run a program using that users npm install. sudo -u pi npm -v says npm not found. su pi -c ...
2
votes
1answer
4k views

Run script at shutdown [duplicate]

I have a script that I want to run at startup and on shutdown. I have placed the file in /etc/init.d and named it testscript.sh Then I changed permissions sudo chmod 755 testscript.sh Then I made ...
1
vote
2answers
7k views

How can I modify an init script on CentOS 7?

I have a script in /etc/init.d that I'm trying to add echo statements to...but all of my changes seem to be ignored. I'm guessing because the script itself is not actually run but that systemd is ...