Forums

Resolved
0 votes
I just setup Hdhomerun DVR on my NAS/Firewall/Router (ClearOS). Process was super easy, sign up for DVR service on https://shop.silicondust.com/shop, link tuners from http://my.hdhomerun.com (step 1 from purchase email) create hdhomerun share on samba (flexshare), on the DVR tab in "HDHomeRun Setup" click the NAS Install and select your hdhomerun folder and the program does the rest (load the executable, creates the config file, and runs the program on the NAS). So it load a program into hdhomerun folder called hdhomerun_record and runs it, now how do a create a service to run at startup.

[root@orion hdhomerun]# ls -al
total 1680
drwxrwxr-x 3 flexshares allusers 4096 Mar 3 18:54 .
drwxr-xr-x 11 root root 4096 Mar 2 20:02 ..
-rw-rw-rw- 1 root allusers 156373 Mar 3 17:53 20190303.log
-rw-rw-rw- 1 root root 8618 Mar 3 19:12 20190304.log
-rw-r--r-- 1 root allusers 91 Mar 2 20:26 hdhomerun.conf
-rwxr-xr-x 1 root root 1527038 Mar 3 18:54 hdhomerun_record
drwxrwxrwx 2 root allusers 4096 Mar 3 19:03 Live TV


https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-unit_files
i found the link above is this what i would follow?
Monday, March 04 2019, 01:18 AM
Share this post:
Responses (5)
  • Accepted Answer

    Monday, March 11 2019, 08:17 AM - #Permalink
    Resolved
    0 votes
    I think from you edit, it is working now?

    The unit file does not have to be executable and it will complain in your logs if it is.

    Do you want hdhomerun to be a foreground service. Normally foreground services are only used if you want to keep watching them in a terminal. If you are starting them as a daemon, then you are trying to run them as a background service. That is my understanding.
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, March 10 2019, 10:37 PM - #Permalink
    Resolved
    0 votes
    edit: I got it, just needed to run #touch hdhomerun.service

    i'm doing something wrong

    i created a hdhomerun.service in /etc/systemd/system. did chmod u+x. did chkconfig hdhomerun on. did systemctl daemon-reload.
    then i start with systemctl start hdhomrun

    then when i check hdhomerun_record status it says not running...

    Usage: hdhomerun_record <command> [<options>]
    Commands:
    start Start the hdhomerun_record daemon
    stop Stop the hdhomerun_record daemon
    status Running status of the hdhomerun_record daemon
    foreground Run hdhomerun_record as a foreground process
    version Display version information
    Options:
    --conf=<filename> Load config from specified file

    # cat /etc/systemd/system/hdhomerun.service
    [Unit]
    Description=DVR Recorder.
    After=network.target

    [Service]
    Type=simple
    WorkingDirectory=/var/flexshare/shares/hdhomerun
    ExecStart=/var/flexshare/shares/hdhomerun/hdhomerun_record foreground
    ExecStop=/var/flexshare/shares/hdhomerun/hdhomerun_record stop
    Restart=always
    RestartSec=10

    [Install]
    WantedBy=multi-user.target
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, March 10 2019, 06:34 PM - #Permalink
    Resolved
    0 votes
    You can do:
    chkconfig your_unit_file_name on
    It is not the proper systemd command, but it will translate it to the proper one and also tell you what it is.

    If you have not rebooted, you'll also need to "register" the unit file with a:
    systemctl daemon-reload
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, March 10 2019, 06:15 PM - #Permalink
    Resolved
    0 votes
    thanks Nick, do i need to register my start script? or is everything in /usr/lib/systemd/system started?
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 04 2019, 08:08 AM - #Permalink
    Resolved
    0 votes
    That is more or less right. I'd suggest you start by copying one of the unit files in /usr/lib/systemd/system. The dnsmasq.service file is very simple to start with or you could look for a slightly more complex one.

    I am not sure the flexshare is the best place the program. It may lose its execute permissions. I'd try loading the program into a different folder (probably under /usr/src/) then look at the config file and see if I could move the downloaded file location to a flexshare, if it is necessary for you to access them from a share. I'd move the log files to /var/log or /var/log/homerun. If homerun does not control the amount of log files it keeps, I'd also set up a tmpwatch job in cron.daily to prune them back
    The reply is currently minimized Show
Your Reply