The situation is the following.
- I have FreeBSD user
M
, which is an alias forroot
, i.e., its UID equals to 0. - I have a daemon started as
M
(as a shell for an autologin console, if it matters). - The daemon should start
screen
non-interactively. And it actually does, but here's the quirk:screen
also starts asM
, thus its socket file is placed to/tmp/screens/M
, not/tmp/screens/root
where I actually need it to be able to attach as root while still leavingscreen
in single-user mode).
I've tried the following without success:
USER=root /usr/local/bin/screen ...
and
sudo /usr/local/bin/screen ...
How does it detect the actual username? How can I force it to think it's really root
and not M
?