Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: andyj on October 31, 2018, 09:05:17 AM
-
At the end of .xsesion is a line to execute personal code when X starts:
[ -d "$HOME/.X.d" ] && find "$HOME/.X.d" -type f -print | while read F; do . "$F"; done
However, there is no equivalent system-wide line that would be used by everyone so that each account's home directory wouldn't have to be touched. Something like this before the personal code line would be a nice addition to the .xsession skeleton:
[ -d "/usr/local/etc/X.d" ] && find "/usr/local/etc/X.d" -type f -o -type l -print | while read F; do . "$F"; done
The specific use case I'm thinking of is open-vm-tools-desktop, but I can imagine more in kiosks, RDP auto connection, and the like.
-
Agreed
-
Could you submit it as a patch please?
-
I hope that at least for open-vm-tools-desktop this will eventually help reduce some confusion. In theory TC should probably autostart services in extensions loaded at boot time, but some of them might depend on settings in /opt/bootsync.sh or /opt/bootlocal.sh. I have this at the end of /opt/bootlocal.sh:
for a in $(find -L /usr/local/etc/init.d -type f); do
[ -x $a ] && $a start &
done
I am not sure how to pull this off in a consistent way without having yet another file, given the default behavior that /opt/bootsync.sh quits once /opt/bootlocal.sh starts.
-
In the meantime, it might not hurt to mention it in the info file?
-
.xsession adjusted in Xlibs in tc-9.x x86 and x86_64 repos
-
On 9.x I see this in both 32 and 64-bit find with the -print option:
tc@box:~$ [ -d "/usr/local/etc/X.d" ] && find "/usr/local/etc/X.d" -type f -o -type l -print
tc@box:~$
The default is to print, so without it I get the expected result:
tc@box:~$ [ -d "/usr/local/etc/X.d" ] && find "/usr/local/etc/X.d" -type f -o -type l
/usr/local/etc/X.d/open-vm-tools
tc@box:~$
Why does the -print option break find?
-
Does it work with full fat find?
-
GNU find works the same. Apparently it is because of the -o or switch. So we need to either use parentheses:
tc@box:~$ [ -d "/usr/local/etc/X.d" ] && find "/usr/local/etc/X.d" \( -type f -o -type l \) -print | while read F; do echo "$F"; done
/usr/local/etc/X.d/open-vm-tools
tc@box:~$
Or accept -print as the default behavior and not use it at all:
tc@box:~$ [ -d "/usr/local/etc/X.d" ] && find "/usr/local/etc/X.d" -type f -o -type l | while read F; do echo "$F"; done
/usr/local/etc/X.d/open-vm-tools
tc@box:~$
I vote for the second more terse option.
-
non-obvious things breaking things still sucks though.