Sudoers error after Box Upgrade command

I tried the QuickBox command “Box Upgrade” and I encounter the same problems as others before. I cant open dashboard and rutorrent any more and the upgrade script stops every time, no matter how often I start visudo and try various corrections of line 26.

/etc/sudoers: syntax error near line 26 <<<
sudo: parse error in /etc/sudoers near line 26
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

I do have plans on cleaning this function up so it’s less destructive (potentially/in some cases).

Could you check that under the section # User privilege specification in the /etc/sudoers files you have an entry that looks like the following:

# User privilege specification
YOURUSERNAMEHERE    ALL=(ALL:ALL) NOPASSWD: ALL
root                ALL=(ALL:ALL) ALL
www-data            ALL = (ALL) NOPASSWD: CLEANMEM, SYSCMNDS, PLUGINCMNDS, PACKAGECMNDS, GENERALCMNDS

The error is: there is just a blank in the sudoers where the “YOURUSERNAMEHERE” should be. When I edit the sudoers with visudo and put my username there, it works. But when you start the box upgrade script, it’s blank again and the script has an error.

I’m not entirely sure why it would be wiping out your username in that field but nothing else.

When you do cat /srv/rutorrent/home/db/master.txt, does it spit something out like the following:

serverhost:~# cat /srv/rutorrent/home/db/master.txt
USERNAMEserverhost:~# 

exactly. nothing (empty line)

But do you see a username before the serverhost? (example as above) Or is it just …

serverhost:~# cat /srv/rutorrent/home/db/master.txt
serverhost:~# 

as root i have no username before serverhost

as normal user i have username@savername

If it is indeed blank and that cat /srv/rutorrent/home/db/master.txt is returning nothing before your serverhost on the next line, do the following:

printf "USERNAMEHERE" > /srv/rutorrent/home/db/master.txt

OK the box upgrade script worked now without error msg.

But I think I have to reinstall the server, I tried a view things to get it up before asking here in the forum. I cant connect to rtorrent now. rutorrent and quickbox sites are up, but with no data…

Restarting rtorrent with systemctl restart rtorrent@USERNAMEHERE doesn’t fire it up?

If not, what does systemctl status rtorrent@USERNAMEHERE show?

[email protected] - rTorrent
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-09-10 19:31:55 CEST; 7s ago
Process: 5070 ExecStop=/usr/bin/killall -w -s 2 /usr/bin/rtorrent (code=exited, status=1/FAILURE)
Process: 5064 ExecStart=/usr/bin/screen -d -m -fa -S rtorrent /usr/bin/rtorrent (code=exited, stat
Process: 5060 ExecStartPre=/bin/rm -f /home/%I/.sessions/rtorrent.lock (code=exited, status=0/SUCC
Main PID: 5066 (code=exited, status=0/SUCCESS)

Sep 10 19:31:55 x systemd[1]: Starting rTorrent…
Sep 10 19:31:55 x systemd[1]: Started rTorrent.
Sep 10 19:31:55 x systemd[1]: [email protected]: Control process exited, code=exited statu
Sep 10 19:31:55 x systemd[1]: [email protected]: Unit entered failed state.
Sep 10 19:31:55 x systemd[1]: [email protected]: Failed with result ‘exit-code’.

Maybe its because of directory permissions?

I just had the exact same problem after running box upgrade.
However, my /srv/rutorrent/home/db/master.txt contained the correct username, but the /etc/apache2/master.txt file was empty.

I solved it simply by overwriting the empty one with the okay one and running upgrade again.
cp /srv/rutorrent/home/db/master.txt /etc/apache2/master.txt
box upgrade
Did not even have to restart any services, everything started working instantly.

A suggestion to devs - maybe the updating functions could do a sanity check, by comparing the variable with an empty string?


ziagl, this might not be the best way, but I’ve had some luck troubleshooting rtorrent, by using sudo to get a shell for the seedbox user and running rtorrent manually.
sudo -u USERNAMEHERE bash
rtorrent

Then, hopefully, it will give you a helpful error message, that can be researched further.

paulsk: I tried to copy the master.txt and rerun box upgrade - did not work too.

I will reinstall the OS and Quickbox now, I am not good enough in linux to find a solution…

This is exactly why QuickBox_Pro is aiming to utilize database and kill off the need for all these random user files (which I don’t like from a security standpoint anyways). It’s very much an alpha release and is a ways off, but this is something I do wish to correct sooner than later.