Getting nzbget to autorun

Yes space separated, but with your output and not mine, so probably not media-externalHD.mount but your 3 disks. If you’re still confused please post the output from;
sudo systemctl list-units --type=mount

I will then post what you should have. If that doesn’t work, you’re on your own :wink:

Hi,

I think I have done what you asked:

[Unit]
Description=NZBGet
After=network.target media-disk1.mount media-disk2.mount media-disk3.mount

[Service]
User=osmc
Group=osmc
Type=forking
ExecStart=/opt/nzbget/nzbget -c /opt/nzbget/nzbget.conf -D
ExecStop=/opt/nzbget/nzbget -Q
ExecReload=/opt/nzbget/nzbget -O
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

Does that seem correct as still not auto booting? :frowning:

I’ve no experience of nzbget, but I do have a few observations/recommendations:

1 Instead of using network.target, I’d recommend that you use network-online.target and ensure that connman-wait-for-network.service is also enabled. After the After = line, add one more line:

Wants = network-online.target

2 What happens if you try to run the ExecStart command /opt/nzbget/nzbget -c /opt/nzbget/nzbget.conf -D from the command line? (With and without the -D.)

3 Close your SSH port on the router:

Jan 07 20:34:24 HTPC sshd[2149]: Failed password for root from 218.92.1.179 port 28175 ssh2

That IP address is coming from China. If you were using the default password for user osmc, it’s very possible that your device has been hacked by now.

2 Likes

I’ll give 1. a shot.
2 - with the -D there is no output, the command just runs, without , we have the following
osmc@HTPC:~$ /opt/nzbget/nzbget -c /opt/nzbget/nzbget.conf
Nzb-file or Url not specified
Usage:
nzbget [switches]

Switches:
-h, --help Print this help-message
-v, --version Print version and exit
-c, --configfile Filename of configuration-file
-n, --noconfigfile Prevent loading of configuration-file
(required options must be passed with --option)
-p, --printconfig Print configuration and exit
-o, --option <name=value> Set or override option in configuration-file
-s, --server Start nzbget as a server in console-mode
-D, --daemon Start nzbget as a server in daemon-mode
-V, --serverversion Print server’s version and exit
-Q, --quit Shutdown server
-O, --reload Reload config and restart all services
-A, --append [] <nzb-file/url> Send file/url to server’s
download queue
are (multiple options must be separated with space):
T Add file to the top (beginning) of queue
P Pause added files
C Assign category to nzb-file
N Use this name as nzb-filename
I Set priority (signed integer)
DK Set duplicate key (string)
DS Set duplicate score (signed integer)
DM (score|all|force) Set duplicate mode
-C, --connect Attach client to server
-L, --list [F|FR|G|GR|O|H|S] [RegEx] Request list of items from server
F List individual files and server status (default)
FR Like “F” but apply regular expression filter
G List groups (nzb-files) and server status
GR Like “G” but apply regular expression filter
O List post-processor-queue
H List history
HA List history, all records (incl. hidden)
S Print only server status
Regular expression (only with options “FR”, “GR”)
using POSIX Extended Regular Expression Syntax
-P, --pause [D|O|S] Pause server
D Pause download queue (default)
O Pause post-processor queue
S Pause scan of incoming nzb-directory
-U, --unpause [D|O|S] Unpause server
D Unpause download queue (default)
O Unpause post-processor queue
S Unpause scan of incoming nzb-directory
-R, --rate Set download rate on server, in KB/s
-G, --log Request last lines from server’s screen-log
-W, --write <D|I|W|E|G> “Text” Send text to server’s log
-S, --scan [W] Scan incoming nzb-directory on server
W Wait until scan completes (synchronous mode)
-E, --edit [F|FN|FR|G|GN|GR|O|H] <IDs/Names/RegExs> Edit items
on server
F Edit individual files (default)
FN Like “F” but uses names (as “group/file”)
instead of IDs
FR Like “FN” but with regular expressions
G Edit all files in the group (same nzb-file)
GN Like “G” but uses group names instead of IDs
GR Like “GN” but with regular expressions
O Edit post-processor-queue
H Edit history
is one of:
- for files (F) and groups (G):
<+offset|-offset> Move in queue relative to current position,
offset is an integer value
T Move to top of queue
B Move to bottom of queue
D Delete
P Pause
U Resume (unpause)
- for groups (G):
A Pause all pars
R Pause extra pars
DP Delete but keep downloaded files
I Set priority (signed integer)
C Set category
CP Set category and apply post-process parameters
N Rename
M Merge
SF Sort inner files for optimal order
S Split - create new group from selected files
O = Set post-process parameter
- for post-jobs (O):
D Delete (cancel post-processing)
- for history (H):
D Delete
P Post-process again
R Download remaining files
A Download again
F Retry download of failed articles
O = Set post-process parameter
B Mark as bad
G Mark as good
S Mark as success
Comma-separated list of file- or group- ids or
ranges of file-ids, e. g.: 1-5,3,10-22
List of names (with options “FN” and “GN”),
e. g.: “my nzb download/myfile.nfo” “another nzb”
List of regular expressions (options “FR”, “GR”)
using POSIX Extended Regular Expression Syntax

  1. Bit of a worry. Do you mean close port 22 on the router?

Does the file exist?

And yes, your open port is a big security risk. If you really need outside SSH access, choose a number > 50000 and (optionally) install something like fail2ban.

The conf. file? -yep

Thanks for the heads up as that was my own stupid fault . I have now changed the password and will change the port ,too.

So you were using the default OSMC password with port 22 open on the router? If so, you should seriously consider a reinstall.

Yes , I guess I didn’t think anyone would bother hacking a HTPC but didn’t consider the ramifications.

Do you not think if the box had been compromised I would have noticed something?

They don’t know what it is and it can still be used as a DDOS bot or bitcoin miner or something else nefarious.

I have just recreated the issue you’re having. Your best bet is to mount the drives in /etc/fstab.

After that change /etc/systemd/system/nzbget.service to;

[Unit]
Description=NZBGet
After=network.target 
RequiresMountsFor=/mnt/Downloads #Change this to your mount points 

[Service]
User=osmc
Group=osmc
Type=forking
ExecStart=/opt/nzbget/nzbget -c /opt/nzbget/nzbget.conf -D
ExecStop=/opt/nzbget/nzbget -Q
ExecReload=/opt/nzbget/nzbget -O
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

Now sudo vim /opt/nzbgt/nzbget.conf

Change main directory to your new main directory.

Save & Quit

Reboot

1 Like

So looking like this:-

rootfs is not mounted in fstab as we do it via initramfs. Uncomment for remount (slower boot)

#/dev/vero-nand/root / ext4 defaults,noatime 0 0

#device mountpoint fstype options dump fsck

/dev/sdb media/disk1 ext4 defaults 0 1
/dev/sdc1 media/disk2 ext4 defaults 0 1
/dev/sda1 media/disk3 ext4 defaults 0 1

Do not mount drives under media/

Yes, when booting it stalls now with a ‘failed to mount message’ emergency mode

What should they be mounted under?

Also, I can’t ssh in now and bluetooth keyboard not working - is USB keyboard only one that’ll work?

First, is it realy /dev/sdb – and not /dev/sdb1?

Second, if you were to use media, it would be /media, with a leading slash. Use /mnt, instead.

Third, I’d recommend that to start with you use noauto,x-systemd.automount 0 0, instead of defaults 0 1 for each disk.

1 Like

Yes - sdb

Will amend once have access to system! :slight_smile:

Reinstalled from SD and got successfully installed message. Now It boots to home screen, then quickly reverts to language selection in set up menu. I cannot progress further as the remote isn’t functional. I have swapped batteries but the same issue.

Any ideas? Ta

Not sure about vero remote but used Kore and it’s working