Service on startup

Hi there

I want to run a script on startup, preferably before Volumio emits the sounds indicating it has booted up. What is the best way to do this?

  1. Make the script a service that runs on boot (not sure this will run before sound)
  2. Write an addon/plugin that somehow hooks into the boot sequence before the sound is played


I believe a plugin will always run before the startup sound, but… I’m kind of interested, because I have a plugin that preferably run after the startup sound.

You could create and run a systemd service script.
Something like this (I took the idea from an example by Michelangelo; thanks):

create a file


and another one


fill it with something like this

Description=your description

ExecStart=/usr/bin/bash /usr/bin/


At the end

sudo systemctl enable yourscript.service

It should work, but I didn’t try it

Thanks RDaneel, that works perfectly. For reference sakes, the timing is in the order of miliseconds before the sound plays.

However I have encountered a slightly strange behavior. For simplicity, the script is simply pulling a LED high with python and RPi.GPIO. A few seconds after booting, the LED turns off. On the other hand if I run the script manually it stays on permanently (aka I only tested longer than a few minutes). I’m not sure if this has something with how the script is written or how it is initialized as a service. I’ve pasted the script’s code below, service file is exactly as linked.

[code]import RPi.GPIO as GPIO


OPTO = 21

GPIO.output(OPTO, True)[/code]

Bump back to front page

In the current version of volumio, the path of bash is
Also, remember to set the permission of your script by
chmod +x /usr/bin/