Create a custom Service in UNRAID


hanzo
Go to solution Solved by mgutt,

Recommended Posts

I have a shell script which I would like to run as a daemon/service.

 

I had a look at the User Scripts plugin and whilst it can run the script. I cannot stop/restart the script.

 

#!/bin/bash

cd /root/myapp

if pgrep -x "/root/myapp/./app" > /dev/null
   then
      echo "Already running"
   else
      echo "Not running. Starting..."
      /root/myapp/./app
fi

 

Is it possible to do something like this in UNRAID?

 

# service myapp start
# service myapp stop
# service myapp restart
# service myapp start
# systemctl start myapp
# systemctl stop myapp
# systemctl restart myapp
# systemctl status myapp

 

Thanks.

Link to comment
  • 8 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.