An issue with an attachment
Benjamin_Loison created repository Benjamin_Loison/Repository_with_an_issue_attac... 2025-02-19 00:55:10 +01:00
Benjamin_Loison closed issue Benjamin_Loison/linux#66 2025-02-18 17:02:48 +01:00
Log /etc/rc.local std{out,err}
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 17:01:11 +01:00
Log /etc/rc.local std{out,err}

I tested on my host Debian 12 GNOME laptop flat wifi:

/etc/rc.local:
#!/bin/sh

LOCAL_USER_NAME=benjamin_loison
SERVER_HOST_NAME=CENSORED_VP…
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 16:45:30 +01:00
Log /etc/rc.local std{out,err}

There is no need to wait 30 seconds after boot in my Virtual Machine Manager virtual machine to access it via SSH:

autossh --help 2>&1 
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 16:42:21 +01:00
Log /etc/rc.local std{out,err}
/etc/rc.local:
#!/bin/sh

USER_NAME=benjamin_loison
SERVER_HOST_NAME=CENSORED_VPS
SERVER_PORT=2224

SCRIPT="$0"
FOLDER_NAME=`echo -n…
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 16:30:51 +01:00
Log /etc/rc.local std{out,err}

Without autossh:

cat _etc_rc_local/std{out,err}.txt
Output:
Start of /etc/rc.local at Tue Feb 18 04:24:02 PM CET 2025
End of /etc/rc.local…
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 16:22:19 +01:00
Log /etc/rc.local std{out,err}

Let us not add tail -c +2 to be precise, despite being less clean in this case.

Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 16:11:26 +01:00
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/
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 15:51:00 +01:00
Log /etc/rc.local std{out,err}

Tested on Debian 12 GNOME.

Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 15:46:54 +01:00
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/
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 15:40:46 +01:00
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…
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 15:37:05 +01:00
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.

Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 15:36:22 +01:00
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…
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 15:34:31 +01:00
Log /etc/rc.local std{out,err}

while [ true ] makes the boot stuck.

Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 14:49:28 +01:00
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…
Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 14:37:58 +01:00
Log /etc/rc.local std{out,err}
cd /root/

works as wanted.

Benjamin_Loison commented on issue Benjamin_Loison/linux#66 2025-02-18 14:34:30 +01:00
Log /etc/rc.local std{out,err}
ls /etc/
Output:
adduser.conf		cups		     group	      libpaper.d      NetworkManager  rc5.d		 sudoers.d
adjtime			cupshelpers	     group-	    …