Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [init-script]

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

-2
votes
0answers
13 views

Linux Startup Script Errors

I am trying to make a startup script, but when I run top, I don't see it running. Here is my startup script: #!/bin/bash # /etc/init.d/mystartupscript.sh cd /home/ubuntu/gvite tmux new "sudo ./gvite" ...
2
votes
1answer
82 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
32 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
8 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
72 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
170 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
48 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
403 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
63 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
100 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
132 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
70 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
72 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
100 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 ...
3
votes
2answers
475 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
664 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
552 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
2k 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 ...
1
vote
1answer
1k 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
306 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 ...
2
votes
1answer
5k 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
18 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.....
0
votes
1answer
161 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
45 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
104 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 ...
0
votes
0answers
62 views

init.d script runs incorrectly on boot but is working when executed manually

I have a very simple script that I have placed in the init.d folder, this script works fine when run manually. But whenever I reboot the server it only does the touch command and does nothing with the ...
2
votes
1answer
1k 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
355 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
189 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
800 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 ...
0
votes
1answer
211 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 ...
0
votes
2answers
3k 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
825 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
287 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
715 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
261 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
459 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
30 views

ANCHORFILE in /etc/init.d scripts

Several /etc/init.d scripts I have looked through contains an ANCHORFILE For e.g. I understand the use of PIDFILE, but not the ANCHORFILE. Can someone explain how this is used? E.g. https://www....
0
votes
0answers
231 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
22 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
2k 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 ...
0
votes
2answers
6k 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 ...
0
votes
1answer
31 views

Set script to be executed at/after boot, with only write permissions, but no shell access on the target

Suppose you have write access to a Linux system, with root rights, but no interactive shell. You can only write new files or overwrite existing files. Creation of (sub)directories is possible. It's ...
0
votes
1answer
3k views

Systemd service creation of Prometheus and Node Exporter

I am trying to create services for both Prometheus and Node Exporter. Both .service files have nearly identical content. #!/bin/sh - # /etc/systemd/system/node_exporter.service [Unit] ...
1
vote
1answer
34 views

How do I start a program at boot-time with a particular user after a few other services have started?

I have an app that I'm looking to do the following with on Oracle Enterprise Linux 7: Run this app at bootup after certain other applications have started (one of them being MongoDB). I want to run ...
1
vote
1answer
77 views

How do I write an LSB init script for a process that already daemonizes properly?

I have a process that already forks into the background, but I can't find any guides anywhere on how to write an init script for a program like this.
3
votes
2answers
2k views

Each service runs twice while booting Fedora 25

I've just installed Fedora 25. However, while starting up the computer, each initialization service runs twice (see the attached picture), or are shown twice on the screen. How can I fix that? (I'm ...
2
votes
1answer
456 views

Error trying to run agetty in a runit based linux installation

I am trying to run agetty in a runit based linux system, but I have the following problem sh: cannot set terminal process group (136) Inappropriate ioctl for device sh: no job control in this shell ...