Having some issues with this. I have the following script:
cd /home/program
screen -S program -d -m ./program.sh
In /etc/init.d and it runs on startup.
Which works fine, but it runs it as root, I don't want it to run as root. I have tried using su programs-user
then doing the screen but it only opens the screen and nothing else. I think it's a permissions thing but I'm not entirely sure as I'm not that familiar with linux.
Edit: this is what I got right now
su username -c "screen -S screen_name -d -m bash -c 'cd /home/user && ./program'"
And it doesn't do anything.
Edit2: I'm guessing cause the user doesn't have permission to run screen, don't know how to give that permission.
Edit3: Ok when I login with the username it is in fact working, but when I type screen -ls
as root I don't see the screens