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

Questions tagged [init.d]

Use "init.d" tag for matters related to scripts run during start-up (and shut-down) by the init process - typically they will start daemons or configure pieces of hardware. As of Raspbian Jessie, the default init system is systemd, but other systems such as Upstart and SysVinit exist for other distributions available on the Pi.

Filter by
Sorted by
Tagged with
0 votes
0 answers
47 views

Issue starting detached screen session on startup

I am running a 1.18.1 Minecraft server on a raspberry pi 4 and I've been impressed by the performance. I usually start the server by starting an ssh session and then starting the server in a screen ...
user avatar
  • 1
0 votes
3 answers
263 views

How to run a script (pointing to a python file) with root permission at startup in Raspberry Pi OS?

I am trying to run a script which ultimately runs a pagekite python file. The Pagekite offers tunnelling service for localhost to be publicly accessible. My aim is to run the pagekite.py when the Pi ...
user avatar
0 votes
0 answers
57 views

RPi Zero W Python Threading.Timer Problem in crontab

t = threading.Timer(20, function=callback_func, args=[]) t.start() The above code is designed to call the callback function after 20 seconds and the callback function sets a global variable. This ...
user avatar
2 votes
2 answers
33 views

Is it possible to bulk load code prior to first boot just as ssh can be enabled or wpa_supplicant can be configured?

Knowing that ssh can be enabled with the initial flashing of an SD card (with raspbian) (via touch /boot/ssh) and wireless can be configured (via wpa_supplicant.conf) prior to first boot, is there ...
user avatar
0 votes
2 answers
475 views

How to pass parameters to program run from init.d?

I'm debugging lirc on a Pi 3b running Stretch with 4.19 kernel. In my previous question, I found a way to cause lircd to function, but it requires invoking the daemon with passed parameters. I ...
user avatar
  • 257
1 vote
3 answers
1k views

lirc won't irsend - special command required - why?

I'm using a Pi 3B as an IR transceiver, using the general approach described by this article. I found that Raspbian kernel 4.19 and beyond have changed lirc. I followed the guidance in this article ...
user avatar
  • 257
-1 votes
3 answers
138 views

How to automatically run a script on boot / startup?

I have trying to get a script to run at startup to mount a flash drive and change ownership on dynamically created files. I have not been successful in getting the script to run. It only runs when I ...
user avatar
0 votes
1 answer
2k views

Starting Real VNC daemon automatically with a boot or reboot

I can use sudo vncserver-x11-serviced & to start a VNC Server as a daemon. I need to execute this command whenever I boot or reboot Raspberry Pi. From https://www.realvnc.com/en/connect/docs/...
user avatar
  • 121
1 vote
1 answer
354 views

Run forever task as root in init.d script on startup

I'm trying to start a nodeJS Server on Raspbian on startup. Everything works fine with this script: #!/bin/sh #/etc/init.d/myService ### BEGIN INIT INFO # Provides: myService # Required-...
user avatar
  • 115
0 votes
0 answers
169 views

Busybox init, is it possible to delay execution of init.d script conditionally?

I would like to boot into a python app. My python app has the excellent pigpiod daemon as a prerequisite. I am using Busybox init process. I have a pigpiod launch script /etc/init.d/SXpigpiod and my ...
user avatar
1 vote
1 answer
2k views

init.d script does not run start on boot but starts manually (Raspbian)

Whenever the system starts, the zfs-import init script does not run: root@kapnet:# /etc/init.d/zfs-import status ● zfs-import.service - LSB: Import ZFS pools Loaded: loaded (/etc/init.d/zfs-import;...
user avatar
  • 149
5 votes
2 answers
4k views

I want to run a Python 3 script on startup and in an endless loop on my Raspberry Pi

I have created a smart vending machine using my Raspberry Pi. For now, I open the Raspberry Pi using SSH and run the script manually for every transaction. I want to automate the process and run the ...
user avatar
0 votes
2 answers
331 views

Trouble getting picam to take a photo on boot (init..d method)

I want the camera on my pi (Rpi 3B+) to take a picture every time it boots up. I've read through several other questions of people trying to do similar things, but I haven't ever found the script that ...
user avatar
1 vote
1 answer
1k views

"service restart" working although init.d script doesn't support "restart"

I wrote the following script /etc/init.d/tomcat in order to manage my manually-installed Apache Tomcat server as a service: #!/bin/sh # # /etc/init.d/tomcat -- startup script for the Tomcat servlet ...
user avatar
0 votes
1 answer
878 views

My script in init.d fails on boot, fails as a service, but works fine when executed manually

I created the following script in /etc/init.d/bootscript.sh The script has these permissions: -rwxr-xr-x 1 root root 855 Aug 1 22:44 bootscript.sh # /etc/init.d/bootscript.sh ### BEGIN INIT INFO # ...
user avatar
4 votes
1 answer
2k views

Clarification about the boot process (systemd / init)

I started disabling some services from systemd to speed up the boot time, but I noticed that many services are also in the old init (which runs). There are quite a few things that start in rc.d (or at ...
user avatar
  • 460
2 votes
0 answers
206 views

Deluge Web and init.d Issues

I'm having trouble getting Deluge Web to work. I'm a bit of a noob, so bare with me. My Pi is set to automatically connect to my VPN provider and run Deluge on boot. The problem is, I want to have ...
user avatar
  • 21
1 vote
1 answer
5k views

boot time start up code on Raspberry pi 3 jessie by adding script under init.d

to run a script at start-up on my Raspberry pi 3 board ( with jessie lite ) : 1- I added one init script under /etc/init.d/ directory. I can start,stop,restart service using script manually. ### ...
user avatar
4 votes
1 answer
14k views

Getting to display images with feh at startup

I can't get my raspberry pi to display images using feh at startup. I have tried placing my simple feh command wrapped in a shell in cron jobs, /etc/rc0-9.d, and init.d but nothing is working. I ...
user avatar
  • 141
2 votes
0 answers
259 views

How to write service on Jessie [closed]

I would like to write a service with the standard start, stop, restart, status interface and that runs on startup and restarts if killed. However, in researching solutions, I've discovered that there ...
user avatar
  • 221
3 votes
1 answer
12k views

How to disable OpenVPN from running at startup on Raspbian?

I'm trying to disable OpenVPN from running at startup. I tried changed the setting for AUTOSTART in /etc/default/openvpn from all to none, but that didn't work. How do I disable OpenVPN from running ...
user avatar
  • 133
4 votes
1 answer
27k views

Raspbian Jessie: What do "service --status-all" and "systemctl list-units --type=service" show?

So, I read a lot about init systems in the last two hours, since this topic was completely new to me. I now know that Raspbian Jessie uses SystemD. I also found out that systemctl list-units --type=...
user avatar
1 vote
0 answers
2k views

Start NGINX Server at Login?

I have an NGINX server (used for RTMP) installed on a Raspberry Pi3 running the latest version of Raspbian (as of this writing). I would like to have the NGINX server start automatically when the Pi ...
user avatar
1 vote
1 answer
2k views

Trying to start a script at startup

I'm trying to write a script which starts a program with some parameters at startup (after boot) and therefore I'm using /etc/init.d. This is my script: #!/bin/bash ### BEGIN INIT INFO # Provides: ...
user avatar
0 votes
1 answer
331 views

How to kill startup script?

I just added a script to send me my ip-address of my pi via email as soon as it starts. Something went terrible wrong with it. On each boot I get a A start job is running for LSB: Raise network ...
user avatar
  • 165
1 vote
1 answer
1k views

How does Raspbian Jessie set the hostname during system startup?

Most systems seem to read the contents of /etc/hostname and make a call to /bin/hostname during the system startup from an init.d (or similar) script. Raspbian Jessie appears to have a different way ...
user avatar
3 votes
1 answer
2k views

How to write an init script

I am developing an automatic watering system on my Pi. The code is C#, run under Mono. I want the system to start automatically when the Pi boots up, so I am trying to create a script in init.d. I ...
user avatar
5 votes
1 answer
5k views

How to find out the default init system of my raspbian?

I want to write a script to enable my program on boot automatically. This can be done using SysV Init, Upstart or systemd. However, I am not able to figure out which init system my Raspbian uses. ...
user avatar
  • 151
1 vote
1 answer
842 views

Why cant I get forever to run on my Raspberry Pi 2 (node 0.10.2

I've installed node 0.10.2 and forever on my raspberry pi. I had to update npm in order to install forever. I've created the following bash script to run my node app, but when I run it, it just prints ...
user avatar
1 vote
3 answers
3k views

Can't stop script from running at start up

Hope this is the correct forum. I'm new to Raspberry Pi and programming. I have been trying to get my script running at startup without any success, until I found an answer on stack overflow. ...
user avatar
  • 39
3 votes
2 answers
13k views

/etc/init/d/tightvncserver script fails at boot

This is the tightvncserver init.d script, tightvncserver, in /etc/init.d: ============ ### BEGIN INIT INFO # Provides: tightvncserver # Required-Start: $remote_fs $syslog # Required-Stop: $...
user avatar
3 votes
3 answers
1k views

When to call script that can capture IP in python

I'm trying to show my local IP on an LCD during startup. My script worked fine during normal testing via the command line, but when called at startup it doesn't seem to be able to fetch the IP. I ...
user avatar
  • 1,651
0 votes
2 answers
3k views

Cannot get Synergy to start with Raspbian

I've tried multiple ways to get it to work, https://learn.adafruit.com/synergy-on-raspberry-pi/setup-synergy-client-autostart https://www.rootusers.com/compiling-synergy-from-source-on-the-raspberry-...
user avatar
  • 11
0 votes
1 answer
3k views

boot script is not called on boot

I have the following script named /etc/init.d/asplashscreen: #! /bin/sh ### BEGIN INIT INFO # Provides: asplashscreen # Required-Start: # Required-Stop: # Should-Start: # Default-...
user avatar
  • 277
2 votes
0 answers
1k views

Get an init.d script to wait for internet? [closed]

I've got an init.d script that starts on boot and all it does it run a shell script. The script, tries to update a github repo before running the server, the idea being, on a reboot everything ...
user avatar
0 votes
1 answer
527 views

Why won't `gpio` work from an init script?

I have an init.d script that successfully runs scripts to an LED board from Adafruit using this software: https://github.com/hzeller/rpi-rgb-led-matrix In addition, I've set up a simple single LED ...
user avatar
2 votes
1 answer
334 views

Latency variation

I have a problem using my raspberry pi 2 for applications that need low latency. I wrote a c++ GPIO routine that reads a high resolution quadrature ttl encoder. It then updates a counter and adds it ...
user avatar
3 votes
1 answer
212 views

init.d possibly caught in loop

I put the script "myscript.sh" with the following content into init.d: #!/bin/bash while : do raspistill -v --width 1920 --height 1440 --quality 10 -t 1000 -o /home/pi/webcam/current.jpg ...
user avatar
  • 133
1 vote
0 answers
738 views

udhcpd init.d script makes trouble using RPi as WiFi AP

I wrote an udhcpd init script. It is more or less like the standard script, which also made trouble. However it supports at least a status output. The problem is that it does not start automatically ...
user avatar
  • 223
2 votes
4 answers
21k views

Raspbian wpa_supplicant fails, which service to (re)start?

I'm using Raspberry Pi 2 installed with Raspbian (Debian Wheezy) ~ Release date: 2015-02-16. Every now and then wpa_supplicant dies on me and usually when I'm remote and I cannot do anything other ...
user avatar
  • 307
3 votes
2 answers
7k views

Stuck in boot after trying to work with init.d script to run at boot

I messed up the boot on a raspberry pi that is meant to run an important project. It started when I was trying to get a script to run at boot. I tried creating a daemon and I successfully started and ...
user avatar
3 votes
2 answers
2k views

Disable Raspi-Config

I am able to view the output of the boot sequence of the RPi, however, I have no USB keyboard and so cannot get past the raspi-config screen. I also do not have a router, I have only a link-local ...
user avatar
  • 183
3 votes
2 answers
3k views

How to run the NTP daemon automatically?

On my RaspBMC, the time drifts pretty much (more than a day in one month). So I started to use NTP, but have problems running it. I called sudo update-rc.d ntp enable, I also added DAEMONS=(!hwclock ...
user avatar
1 vote
0 answers
678 views

How can I get my init.d script to be the last startup item on runlevel 4?

After reading a lot of other questions regarding kiosk mode, I'm using matchbox window manager to launch chromium on my pi that is booting raspbian. I'm started using an older script that was ...
user avatar
  • 318
2 votes
2 answers
17k views

Access denied when starting systemd service

Noob question, but hopefully someone can help me out here. I'm transitioning from init.d to systemd on my RPi running Linux, as I'm told it would cut my boot time in half. My init script requires ...
user avatar
1 vote
1 answer
187 views

How do I run a script (that needs WIFI) on shutdown before WIFI is down

I have a script on the PI to shutdown my NAS "shutdown_nas.sh". I have created that script in /etc/init.d according to the instructions in /etc/init.d/README It is symlinked in /etc/rc0.d/...
user avatar
  • 1,396
3 votes
1 answer
2k views

Redirecting stdout and stderr to UART

I am building my own cross-linux-from-scratch (CLFS) system for Raspberry Pi. I already build whole system, I prepared SD card and now I try to boot. I am redirecting all kernel output to serial ...
user avatar
  • 161
1 vote
3 answers
14k views

Using init.d script to start my python program on startup

I have a python script that I would like to be run at startup. I have made a init.d script as follows: #! /bin/sh case "$1" in start) echo "starting pitracker" su 'pi' -c 'python3 /home/...
user avatar
2 votes
1 answer
12k views

Run python-flask server from daemon

I have a python script that uses Flask to run a web server on my Raspberry Pi. This script is working just fine when run from the command line directly but I would love for it to start in the ...
user avatar
  • 121
2 votes
3 answers
8k views

Deluge have no init scripts?

Deluge have no init scripts in raspberry pi repository? root@rpi ~# service deluged start deluged: unrecognized service root@rpi ~# service deluge-web deluge-web: unrecognized service But deluged ...
user avatar