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

New answers tagged

0

The example you used at systemd is a bad example. It states to Restart=always. That doesn't help to "fix" a buggy service that failed to run stable. It will only spam your system with starting attempts until it will give up after some minutes. In particular for your case it doesn't fit because you need to run your service only one time at start up and do ...


0

Now you have your script running as a systemd daemon, you can review its status using journalctl. You don't even really need to write your startup message to a file as journalctl will show you every time the service starts... But of course you can see startup by inspecting the contents of /var/log/syslog , and dmesg will also be useful.


1

As noted in a comment on your question, the error suggests that a Python module is not found, which is controlled in part by environment variables such as (but not limited to) PYTHONPATH. (See, for a full description, the documentation for Python modules.) Note that this is different than saying your script runs before MySQL starts. That may or may not be ...


1

/etc/profile is NOT for starting user code. It is:- # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) i.e. it is for configuring your shell (even if you wanted to do this you should probably use ~/.bash_profile or ~/.profile) There are many ways of running a script on boot (depending on what you want to do). Often rc.local is used, ...


0

NOOBS is not an OS The link you listed is for an obsolete OS, and has no relevance the current Raspbian GUI or to Linux systemd. You need to list your script to get a definitive answer, it depends on what it does. https://www.raspberrypi.org/documentation/linux/usage/systemd.md shows how to start a general (non GUI) script.


0

My guess is the init level may not be set high enough yet for an X session. You might add a sleep 120 to the cron and possibly a nohup: @reboot sleep 120;nohup /bin/sh /home/pi/bbt/launcher.sh >/home/pi/logs/cronlog 2>&1 (edit: I also fully qualified the /bin/sh but I doubt that's the issue)


1

You can't run something at startup that should open a window, because the X Server is not yet available. Additionally, cron jobs don't normally have access to the X Server. However, it is possible to connect to the X Server if you prepare the correct environment. Normally, what you need are the DISPLAY, XAUTHORITY and XAUTHLOCALHOSTNAME variables. To ...


0

You can put your commands in ~/.bashrc and they'll be executed when you open a terminal.


Top 50 recent answers are included