[Newark] Running a simple script as a service

Richard Street mr.r.street at gmail.com
Mon Mar 1 13:09:00 UTC 2021


No idea mate. Have you tried the usual? File permissions, is it executable
(both the script and the system control file), does the new service need
'enabling' somewhere (I'm thinking where the script used to need linking in
your RC folders to be active on SysV init).

I've not created any systemd services myself so I'm sorry I can't be more
help.


On Mon, 1 Mar 2021, 12:25 Richard M Eggleston via Newark, <
newark at mailman.lug.org.uk> wrote:

> Hi All,
>
> I realise this is fairly low level stuff, and I have spent a fair bit of
> time on search engines and forums, but my specific question isn’t being
> addressed
>
>
> I have been running sickgear as a PVR (I know about torrents and copyright
> breach..don’t @me, I’m a big boy) however it starts by running the
> following from a command line
>
> Cd /opt/sickgear
> Sudo -u python3 ./sickgear.py
>
> And that works nicely
>
> So being a good soldier,(i.e Lazy) I combined these into a bash script
> (called runsickgear.sh)
>
> #!/bin/bash
> Cd /opt/sickgear
> Sudo -u python3 ./sickgear.py
>
> Which can be run from CL and works beautifully..
>
> bash runsickgear.sh
>
> Now me, being me, I don’t want the hassle of running no lousy scripts, and
> I don’t want any untidy terminals left open either (OCD? No not me)
> I would like this to run as a service at boot time, and Be stopped,
> started and messed around with using
>
> Sudo systemctl sickgear {stop/start/enable/halt & catchfire}
>
> SO I copy the runsickgear.sh script to
>
> /usr/bin/sickgear/runsickgear.sh
>
> Generate a file /etc/systemd/system/sickgear.service
>  Which looks like
>
>
> [Unit]
> Description=sickgear service
>
> [Service]
>  ExecStart=/usr/bin/sickgear/runsickgear.sh
>
> [Install]
> WantedBy=Multi-User.Target
>
> Now according to Google, etc after I run
> Sudo systemctl daemon-reload
> Then I should be able to do systemctl enable etc
>
> But I can’t,
>
> And the logs seem to give me no insight, and the Ubuntu forums seem more
> interested in angels dancing on heads of pins or whether
> I am fairly sure this is a syntax error somewhere, but what ever I do, it
> doesn’t seem to work.. Given my desk and keyboard now have forehead shaped
> dents in need help. Google has loads o examples, and I have worked through
> many of them (Mostly look the same as the ones I’ve shown)
>
> Any bright ideas?
>
> Cheers
> Richard
>
> --
> Newark mailing list
> Newark at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/newark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/newark/attachments/20210301/4c928027/attachment-0001.html>


More information about the Newark mailing list