The Raspberry Pi Thread

booo

BA BA BA BABANANA
Skilled
Ok so how do I check the status? I know that at least with this dietpi installation, if I switch off the Pi and switch it back on, everything (all services) start again.
Bash:
sudo systemctl status qbittorrent
and yes. they start every time when the system is rebooted.
please post the output of

Bash:
cat /etc/systemd/system/qbittorrent.service
 

raksrules

Well-Known Member
Elite
@booo Here you go....

Code:
root@DietPi:~# cat /etc/systemd/system/qbittorrent.service
[Unit]
Description=qBittorrent (DietPi)
Documentation=man:qbittorrent-nox(1)
Wants=network-online.target
After=network-online.target dietpi-boot.service

[Service]
User=qbittorrent
UMask=002
ExecStart=/usr/bin/qbittorrent-nox

[Install]
WantedBy=multi-user.target
root@DietPi:~#
 

codelad

Well-Known Member
Disciple
... please post the output of

Bash:
cat /etc/systemd/system/qbittorrent.service
While you're at it, please also examine output of:
Code:
systemctl show qbittorrent | grep -ie '\(fail\|restart|abort\)'

And also the status of the service, right after the crash.
 

raksrules

Well-Known Member
Elite
@booo @codelad

I have made modifications in the file and this is how it looks now...

Bash:
root@DietPi:~# cat /etc/systemd/system/qbittorrent.service
[Unit]
Description=qBittorrent (DietPi)
Documentation=man:qbittorrent-nox(1)
Wants=network-online.target
After=network-online.target dietpi-boot.service

StartLimitIntervalSec=500
StartLimitBurst=5


[Service]

Restart=on-failure
RestartSec=5s

User=qbittorrent
UMask=002
ExecStart=/usr/bin/qbittorrent-nox

[Install]
WantedBy=multi-user.target
root@DietPi:~#
 

codelad

Well-Known Member
Disciple
@booo @codelad

I have made modifications in the file and this is how it looks now...

Bash:
root@DietPi:~# cat /etc/systemd/system/qbittorrent.service
[Unit]
Description=qBittorrent (DietPi)
Documentation=man:qbittorrent-nox(1)
Wants=network-online.target
After=network-online.target dietpi-boot.service

StartLimitIntervalSec=500
StartLimitBurst=5


[Service]

Restart=on-failure
RestartSec=5s

User=qbittorrent
UMask=002
ExecStart=/usr/bin/qbittorrent-nox

[Install]
WantedBy=multi-user.target
root@DietPi:~#
In case you haven't done so already, please re-enable the service with:
Code:
systemct reenable qbittorrent

And watch out for that additional line-break after [Service].
 

raksrules

Well-Known Member
Elite
In case you haven't done so already, please re-enable the service with:
Code:
systemct re-enable qbittorrent

And watch out for the line-break after [Service].


You mean the line break should not be there? It is ok I can fix it. Also did the enable thing and this is what it says...

Bash:
root@DietPi:~# sudo systemctl enable qbittorrent
Created symlink /etc/systemd/system/multi-user.target.wants/qbittorrent.service → /etc/systemd/system/qbittorrent.service.
 

codelad

Well-Known Member
Disciple
You mean the line break should not be there? It is ok I can fix it. Also did the enable thing and this is what it says...
Yes, I don't think the syntax allows for that extra line-break after [Section]. Just to be certain, could you please post output of:
Code:
systemctl cat qbittorrent

Bash:
root@DietPi:~# sudo systemctl enable qbittorrent
Created symlink /etc/systemd/system/multi-user.target.wants/qbittorrent.service → /etc/systemd/system/qbittorrent.service.
I think you should be set now. It is probably unnecssary, but you may want to reboot your machine for good measure.

P.S. - Just discovered a mistake. The command should be "reenable" (and not just "enable") for it to take effect, since you made a change in the configuration.
 
Last edited:

raksrules

Well-Known Member
Elite
@codelad

Bash:
root@DietPi:~# systemctl cat qbittorrent
# /etc/systemd/system/qbittorrent.service
[Unit]
Description=qBittorrent (DietPi)
Documentation=man:qbittorrent-nox(1)
Wants=network-online.target
After=network-online.target dietpi-boot.service

StartLimitIntervalSec=500
StartLimitBurst=5


[Service]
Restart=on-failure
RestartSec=5s

User=qbittorrent
UMask=002
ExecStart=/usr/bin/qbittorrent-nox

[Install]
WantedBy=multi-user.target
root@DietPi:~#
 

bobbyprajan

Well-Known Member
Disciple
I followed the instructions here for my Raspberry Pi 4 heating issue. The fan comes on when the temps exceed 62 and switches off at 50. This can be changed in the config files to your requirements. The circuit is very simple with just 1 transistor, diode and resistor. Without speed control the fan noise will become an irritant especially at night

For downloads I had used rtorrent and rutorrent in Pi which are not very resource hungry. Guides are available on how to set these up
 

raksrules

Well-Known Member
Elite
I followed the instructions here for my Raspberry Pi 4 heating issue. The fan comes on when the temps exceed 62 and switches off at 50. This can be changed in the config files to your requirements. The circuit is very simple with just 1 transistor, diode and resistor. Without speed control the fan noise will become an irritant especially at night

For downloads I had used rtorrent and rutorrent in Pi which are not very resource hungry. Guides are available on how to set these up

Can you check if there is a way to install autodl-irssi with rtorrent / rutorrent? I used this combination on my seedbox that I used to have and would like it here too.
 

Marcus Fenix

Well-Known Member
Skilled
Why am I not getting alerts for this thread?

Put this code in a shellscript say qbittorrent_restart.sh in "/mnt/dietpi_userdata/scripts" path.
Keep in mind the End of Line should be LF(UNIX line feed or \n) instead of CRLF(Carriage return line feed i.e. \r\n which is Windows format).

#!/bin/sh

STATUS=`/boot/dietpi/dietpi-services status qbittorrent | grep "running"`

if [ -z "$STATUS" ] ;
then
/boot/dietpi/dietpi-services start qbittorrent
else
echo "qbittorent is running"
fi

Then hit crontab -e
and add this to run the script every 10 minutes like this-

*/10 * * * * /mnt/dietpi_userdata/scripts/qbittorrent_restart.sh
 

Marcus Fenix

Well-Known Member
Skilled
@Marcus Fenix After I have done all the steps before your post here, do I still need to do what you mentioned?
What you have done beforehand is the standard UNIX way of handling this via systemctl.

dietpi-services is a wrapper which makes handlng this stuff easier. If I had gotten notifications for this thread earlier I would have told you
Can you check if there is a way to install autodl-irssi with rtorrent / rutorrent? I used this combination on my seedbox that I used to have and would like it here too.
Not sure if this will work but there's a fork for autodl-irssi in rutorrent compatible with Debian 10 buster.
 
Last edited:

raksrules

Well-Known Member
Elite
Guys need help. I think i messed up my dietpi installation and only option seems to be the start from scratch.

I was uninstalling Pi-Hole (had never configured it) and it asked me if I wanted to remove dependencies and i selected yes and it started prompting me to uninstall them one by one which I stupidly did and then i lost connect to Pi. No SSH, no ping, nothing.

Does anyone have any idea what I can do, any way to repair this or only option is to format sd card, again create bootable card and start afresh ?

@Marcus Fenix @tommy_vercetti @codelad
 
Last edited:

Marcus Fenix

Well-Known Member
Skilled
Guys need help. I think i messed up my dietpi installation and only option seems to be the start from scratch.

I was uninstalling Pi-Hole (had never configured it) and it asked me if I wanted to remove dependencies and i selected yes and it started prompting me to uninstall them one by one which I stupidly did and then i lost connect to Pi. No SSH, no ping, nothing.

Does anyone have any idea what I can do, any way to repair this or only option is to format sd card, again create bootable card and start afresh ?

@Marcus Fenix @tommy_vercetti @codelad
Did you run a backup using dietpi-backup to your attached HDD before install/uninstall?

If not then welcome to the same mistakes I made in the early days.
 
Top