Tiny Core Extensions > TCE Bugs

seatd & copy2fs.flg

<< < (3/5) > >>

aus9:
Ok I found 2 "working with less typing commands" ...I tried in my ~/.local/bin/west
last lines are

--- Code: --- $ seatd-launch weston # (about 20 keystrokes) BUT I use a dbus session I prefer
$ seatd-launch dbus-run-session weston # (about 36 keystrokes)
--- End code ---

 and this is what I used while I am typing this. So comparing Apps method A =  $ sudo -- seatd -g staff -n /run/seatd.sock &  weston  (about 50 keystrokes) (adding dbus-run-session > 60 keystrokes)

The first part of the explanation is this command is SUID so can drop sudo as we are temporary root, no need to mention the group staff because we are still temp root. We can drop the command to create a new seat as its a seat management system so of course it will create a seat

Rich:
Hi aus9

--- Quote from: aus9 on January 25, 2026, 09:09:14 PM --- ... How about I change your -d test to something like this? ...

--- Quote --- ----- Snip -----
[ -d "$LOOP" ] || rm -rf /usr/local/bin/seatd* && cp $LOOP/seatd* /usr/local/bin
 ----- Snip -----
--- End quote ---
...
--- End quote ---
That doesn't look right. If the directory exists, you want to execute the
next 2 commands. That means it would look like this:

--- Code: ---[ -d "$LOOP" ] && rm -rf /usr/local/bin/seatd* && cp $LOOP/seatd* /usr/local/bin
--- End code ---

I'll demonstrate. We'll create a Loop variable, 3 file names, use  ls  instead of  rm
and  echo  instead of  cp:

--- Code: ---tc@E310:~/Test$ Loop="/home/tc/.local/bin"
tc@E310:~/Test$ touch x1 x2 x3
tc@E310:~/Test$ [ -d "$Loop" ] || ls x* && echo "Copy"
Copy
tc@E310:~/Test$
--- End code ---
It skipped the first command and only executed the second command.

Lets try it the other way:

--- Code: ---tc@E310:~/Test$ [ -d "$Loop" ] && ls x* && echo "Copy"
x1  x2  x3
Copy
tc@E310:~/Test$
--- End code ---
It executed both commands.

Here's another thing to watch out for when chaining commands like this.
What happens if the first command fails:

--- Code: ---tc@E310:~/Test$ [ -d "$Loop" ] && ls y* && echo "Copy"
ls: cannot access 'y*': No such file or directory
tc@E310:~/Test$
--- End code ---
The  ls  command fails so the  echo  command never runs.

By the way, this happens if the directory does not exist:

--- Code: ---tc@E310:~/Test$ Loop2="/home/tc/.local/bin2"
tc@E310:~/Test$ [ -d "$Loop2" ] || ls x* && echo "Copy"
x1  x2  x3
Copy
tc@E310:~/Test$
--- End code ---
It executes both commands, which is the opposite of what you want.

I usually take the  if [ TEST ]; then Commands; fi  approach because it's
harder to mess up. On occasions I do chain commands, I first create test
cases like above using harmless  ls  and  echo  commands to make sure
I got it right.

Rich:
Hi aus9

--- Quote from: aus9 on January 26, 2026, 05:43:27 AM --- ... How do I prove I am on copy2fs without screenshotting my Apps that shows some "installation options" ...
--- End quote ---
If you:

--- Code: ---touch /etc/sysconf/tcedir/copy2fs.flg
--- End code ---
and then reboot, the contents of all of your extensions get copied
to RAM instead of being loop mounted with links to the file system.

So it you then:

--- Code: ---ls /tmp/tcloop/seatd
--- End code ---
you should see:

--- Code: ---ls: cannot access '/tmp/tcloop/seatd': No such file or directory
--- End code ---

To restore you system to mount mode, delete  /etc/sysconf/tcedir/copy2fs.flg
and reboot.

M-A-X:
Is it really required to assign SUID permissions to seatd?

As we have seen this method in the seatd installation script (replacing the symlink with a regular executable file) has potential for bugs.
Furthermore it basically does not agree with the core philosophy for extensions:
 => Mount Mode = Symlinks in rootfs to the mounted TCLOOP
 => Copy Mode= Regular Files in rootfs

I believe most linux users (including me) would not mind typing "sudo seatd ..." to start the program.

aus9:
Rich
my bad that not how I made it ....it reads

--- Quote ---#!/bin/sh
# make SUID
SRC=/usr/local/share/seatd/files
FILE1=/usr/local/bin/seatd
FILE2=/usr/local/bin/seatd-launch
[ -f $FILE1 ] || cp $SRC/seatd        /usr/local/bin
[ -f $FILE2 ] || cp $SRC/seatd-launch /usr/local/bin
chmod a+s /usr/local/bin/seatd*
--- End quote ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version