Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide on how to not start on boot and to start via a desktop shortcut needed #340

Open
poke50uk opened this issue Sep 12, 2024 · 1 comment

Comments

@poke50uk
Copy link

As not really a Linux user, but as a keen fan, I do want to use my Pi for other things at times. It'll be good to have on your guide a how to on not running the app straight away and how to run it from a desktop shortcut when ready.

@egburr
Copy link
Contributor

egburr commented Nov 22, 2024

Joustmania uses the "supervisor" process manager by installing the configuration file:
/etc/supervisor/conf.d/joust.conf

If you do not want joustmania to start at boot time, add the following line to the configuration file:
autostart=false

If not specified, autostart defaults to true.

You can use the following commands to manage joustmania:

# start
sudo supervisorctl start joustmania

# status
sudo supervisorctl status joustmania

# stop
sudo supervisorctl stop joustmania

All the following has been addressed by #346 and will no longer be relevant once that is applied.

sudo pkill -9 -f piparty

Unfortunately, supervisor stop only kills the primary process of joustmania and not all of the child processes it spawns, so the game remains running even though supervisor thinks it has been stopped. So you must then issue the pkill to finish the job. You can't issue only the pkill, because if supervisor hasn't been told to stop, it will autorestart joustmania as soon as you kill it.

To fix this so the pkill is not needed, add the following lines to the above-mentioned configuration file.

stopasgroup=true
killasgroup=true

Finally, joust (I don't know if it is python or joust specifically) seems to ignore the sigterm that serpervisor initially issues for the stop, so there is a delay before supervisor then issues a sigkill. To bypass this delay and have the sigkill issued immediately, add this line:
stopsignal=KILL

You will need to restart the supervisor (or reboot) before any of the above configuration changes will take effect.

With all the above changes (except I'm keeping autostart=true), my current /etc/supervisor/conf.d/joust.conf file looks like this:

[program:joustmania]
command=/home/egburr/JoustMania/joust.sh
directory=/home/egburr/JoustMania/
autostart=true
autorestart=true
startretries=1000
stopsignal=KILL
stopasgroup=true
killasgroup=true
stderr_logfile=/var/log/joustmania-err.log
stdout_logfile=/var/log/joustmania-out.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants