You are not logged in.
While unit testing, to hopefully use sudo privs for certain actions, but use wget with a non-sudo user for file retrieval. I had initiated the following script in hopes of finding the desired affect. Bash -x got as far as sudo -iu, and then promptly reboots itself almost seemingly skipping a majority of typical shutdown tasks, as the bios screen shows up as abruptly as the shutdown process. Part of the reason why I'm not posting log entries, or even trying. I am, partly also, uncertain of which log to look in for what could be some form of erroneous permission noise.
Make note that the following script was initiated x3 times using 'sudo bash -x unit-test' and had precisely the same outcome each iteration.
Conditions:
$ uname -a
... 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 ...
$ bash --version
... 4.4.12(1)-release
$ sudo --version
... 1.8.19p1
$ /usr/bin/x-terminal-emulator --version
terminator 1.90
$ cat -n unit-test
1 #!/bin/bash --
2
3 touch ./$USER.v1
4 sudo -iu mrjcsh && \
5 touch ./$USER.v2
6 exit # breaks subshell
7 touch ./$USER.v3
8 exit 0
Last edited by mrjcsh (2019-07-18 03:47:10)
Offline
Weird.
Not sure.
What happens if you ‘set +x’ just before the sudo -iu line, to see if it the debug mode that causes it.
Offline
as expected, the output cuts out right at 'set +x'. I have found that sudo -u doesn't kill off the system. Though, the question still remains, why does it hardware level reboot like that? I haven't connected the os to the internet yet, as I'm going through the usual cis compliance hoops and script generation for re-application. So, bare in mind, I only have the as of a week ago installed experience to work with.
Offline
a bit late now, but...
I am, partly also, uncertain of which log to look in for what could be some form of erroneous permission noise.
you should look in systemd's journal via
journalctl -b
I'm sure there's something in it that pertains to your problem.
You just might need to enable persistent journals first, then reproduce the problem.
Offline