Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

Create My Deamon Systemd with autostart/autorestart
Thank you for your donation

Thread Closed 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Create My Deamon Systemd with autostart/autorestart
29th Nov, 2019, 08:40 PM
Post: #1
dvv06 Offline
Registered
Posts: 13
Joined: Feb 2019
Reputation: 2
Create My Deamon Systemd with autostart/autorestart
Hello to all!
And I have:
1. RPi3B +
2. Xbian 18.1
3 AceStream Media pakage (installed and successfully working if you run the startup script manually)
/home/xbian/acestream.engine/acestream.start
-------------
Necessary:
Run on startup Xbian (preferably restart on crash)
What did you do:
1. Made an acestream.service file with the following contents
[Unit]
Description=AceStream
After=network-online.target

[Service]
Type=simple
User=root
Group=root
ExecStart=/home/xbian/acestream.engine/acestream.start
ExecStop=/home/xbian/acestream.engine/acestream.stop
TimeoutSec=2
# Restart = always

[Install]
WantedBy=multi-user.target
-------------
2. copied it to /lib/systemd/system
3. Executed commands:
systemctl enable acestream - a symbolic link was successfully created in /etc/systemd/system/multi-user.target.wants/acestream.service
but cannot start acestream as a service command:
systemctl start acestream
Output:
Failed to start acestream.service: Unknown unit: acestream.service
See system logs and 'systemctl status acestream.service' for details.

On command:
systemctl -l status acestream
It produces:
Failed to get properties: No such interface ''
--------

At the moment, as a temporary option, added the line to /etc/rc.local
/home/xbian/acestream.engine/acestream.start&
but PVR IPTV Ssimple Client is loaded before the acestream engine and the channel list is not loaded

P.S: Sorry for my English, this is not my native language.
Find all posts by this user
29th Nov, 2019, 09:42 PM
Post: #2
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Create My Deamon Systemd with autostart/autorestart
XBian does not use Systemd, using Upstart instead

For your need, please look into file /etc/default/xbmc, parameter USERRUN and/or WAITFOR

In parameter WAITFOR you can define daemon(s) to wait before Kodi is starting

In oarameter USERRUN you can define your own user script
Find all posts by this user
30th Nov, 2019, 12:41 AM
Post: #3
dvv06 Offline
Registered
Posts: 13
Joined: Feb 2019
Reputation: 2
RE: Create My Deamon Systemd with autostart/autorestart
(29th Nov, 2019 09:42 PM)Nachteule Wrote:  XBian does not use Systemd, using Upstart instead

For your need, please look into file /etc/default/xbmc, parameter USERRUN and/or WAITFOR

In parameter WAITFOR you can define daemon(s) to wait before Kodi is starting

In oarameter USERRUN you can define your own user script

The file /etc/default/xbmc indicates
USERRUN = "/usr/local/sbin/user-run.sh"

I created the executable (+ x) script user-run.sh at the specified path
/home/xbian/acestream.engine/acestream.start
But XBian did not boot, but switched to command line mode, where I deleted the specified user-run.sh file.

Tell me where to register autorun /home/xbian/acestream.engine/acestream.start before starting the PVR IPTV Simple Client plugin.
Find all posts by this user
30th Nov, 2019, 02:02 AM
Post: #4
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Create My Deamon Systemd with autostart/autorestart
Quote:Tell me where to register autorun /home/xbian/acestream.engine/acestream.start before starting the PVR IPTV Simple Client plugin.

I'm missing the magic word AngryAngryAngry

Code:
#!/bin/sh

echo "-----------------------------------"
echo "$(date) $0 $@"
echo "-----------------------------------"

case $1 in

        screensaver)            # See /etc/init/xbmc-screensaver.conf
                case $2 in
                        start)
                                ;;
                        stop)
                                ;;
                esac
                ;;

        preload)                # See /etc/init/xbmc-preload.conf
                case $2 in
                        start)
                                /home/xbian/acestream.engine/acestream.start || :
                                ;;
                        stop)
                                # This never happens
                                ;;
                esac
                ;;

        xbmc)                   # See /etc/init/xbmc.conf
                case $2 in
                        start)
                                ;;
                        stop)
                                ;;
                esac
                ;;
                
esac

exit 0
Find all posts by this user
30th Nov, 2019, 02:45 AM
Post: #5
dvv06 Offline
Registered
Posts: 13
Joined: Feb 2019
Reputation: 2
RE: Create My Deamon Systemd with autostart/autorestart
(30th Nov, 2019 02:02 AM)Nachteule Wrote:  
Quote:Tell me where to register autorun /home/xbian/acestream.engine/acestream.start before starting the PVR IPTV Simple Client plugin.

I'm missing the magic word AngryAngryAngry

Code:
#!/bin/sh

echo "-----------------------------------"
echo "$(date) $0 $@"
echo "-----------------------------------"

case $1 in

        screensaver)            # See /etc/init/xbmc-screensaver.conf
                case $2 in
                        start)
                                ;;
                        stop)
                                ;;
                esac
                ;;

        preload)                # See /etc/init/xbmc-preload.conf
                case $2 in
                        start)
                                /home/xbian/acestream.engine/acestream.start || :
                                ;;
                        stop)
                                # This never happens
                                ;;
                esac
                ;;

        xbmc)                   # See /etc/init/xbmc.conf
                case $2 in
                        start)
                                ;;
                        stop)
                                ;;
                esac
                ;;
                
esac

exit 0

Thank you so much sir! I will try. Rolleyes
Find all posts by this user
30th Nov, 2019, 04:58 AM
Post: #6
Skywatch Offline
Registered
Posts: 1,018
Joined: Mar 2013
Reputation: 28
RE: Create My Deamon Systemd with autostart/autorestart
(30th Nov, 2019 02:02 AM)Nachteule Wrote:  I'm missing the magic word AngryAngryAngry
Abracadabra ??? Tongue
Find all posts by this user
5th Dec, 2019, 08:25 AM
Post: #7
gkusiak Offline
Registered
Posts: 176
Joined: Nov 2019
Reputation: 2
Create My Deamon Systemd with autostart/autorestart
No, better: Please.


Sent from my iPhone using Tapatalk
Find all posts by this user
5th Dec, 2019, 08:30 AM
Post: #8
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Create My Deamon Systemd with autostart/autorestart
(5th Dec, 2019 08:25 AM)gkusiak Wrote:  No, better: Please.


Sent from my iPhone using Tapatalk

Big GrinBig GrinBig Grin
Find all posts by this user
20th Jun, 2022, 05:40 PM
Post: #9
kalyl Offline
Banned
Posts: 1
Joined: Jun 2022
RE: Create My Deamon Systemd with autostart/autorestart
systemd is a system and service manager flagle that is responsible for starting and stopping services. systemd is used by many Linux distributions to replace initd, which is no longer supported.
Find all posts by this user
« Next Oldest | Next Newest »
Thread Closed 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 10th May, 2025, 01:28 AM Powered By MyBB, © 2002-2025 MyBB Group.