While under root user (printed by whoami), execution of
sh -c "screen -d -m -S testscreen sh -c \"echo asd; echo qwe\""
creates a screen with two lines output, which can be reattached via screen -r testcreen
But if I'm using
sudo -n -u root sh -c "screen -d -m -S testscreen sh -c \"echo asd; echo qwe\""
the screen does not appear in list. What's wrong and what should I do instead?
(CentOS 5.2)