- https://github.com/Benjamin-Loison
- Joined on
2022-10-16
Block a user
Log
/etc/rc.local
std{out,err}
Let us not add tail -c +2
to be precise, despite being less clean in this case.
Log
/etc/rc.local
std{out,err}
/etc/rc.local
:
#!/bin/sh
SCRIPT='/etc/rc.local'
FOLDER_NAME=etc_rc_local
su --login benjamin_loison -c "
mkdir $FOLDER_NAME/
…
Log
/etc/rc.local
std{out,err}
/etc/rc.local
:
#!/bin/sh
SCRIPT='/etc/rc.local'
FOLDER_NAME=etc_rc_local
su --login benjamin_loison -c "
mkdir $FOLDER_NAME/
…
Log
/etc/rc.local
std{out,err}
head -n 5 etc_rc_local/std{out,err}.txt
Output:
==> etc_rc_local/stdout.txt <==
Start of /etc/rc.local at Tue Feb 18 03:38:16 PM CET 2025
Tue…
Log
/etc/rc.local
std{out,err}
Shell:
while [ true ]
do
echo hey
sleep 1
done >> log.txt &
[1] 95309
log.txt
correctly get filled.
Log
/etc/rc.local
std{out,err}
Shell:
while [ true ]
do
echo hey
sleep 1
done &
[1] 95150
benjamin_loison@Benjamin-Loison-HP-Debian:~$ hey
hey
hey
hey
^C
benjamin_loison@B…
Log
/etc/rc.local
std{out,err}
#!/bin/sh
SCRIPT='/etc/rc.local'
FOLDER_NAME=etc_rc_local
su --login benjamin_loison -c "
mkdir $FOLDER_NAME/
cd $FOLDER_NAME/
(
echo \"Start of $SCRIPT at…
Log
/etc/rc.local
std{out,err}
ls /etc/
Output:
adduser.conf cups group libpaper.d NetworkManager rc5.d sudoers.d
adjtime cupshelpers group- …
Log
/etc/rc.local
std{out,err}
mktemp --suffix _etc_rc_local_stdout
/tmp/tmp.hdUio8goPt_etc_rc_local_stdout
However, permanent with date logs would be nice.
Log
/etc/rc.local
std{out,err}
sudo chmod +x /etc/rc.local
ls -l /etc/rc.local
-rwxr-xr-x 1 root root 134 Feb 18 14:22 /etc/rc.local
Log
/etc/rc.local
std{out,err}
I have:
ls -l /etc/rc.local
-rw-r--r-- 1 root root 134 Feb 18 14:22 /etc/rc.local
Log
/etc/rc.local
std{out,err}
sudo find / -name 'my_stdout.txt' 2> /dev/null
does not return anything on reboot.
Log
/etc/rc.local
std{out,err}
/etc/rc.local
:
#!/bin/sh
(echo my_stdout_content && echo my_stderr_content >&2)
Log
/etc/rc.local
std{out,err}