F5F Stay Refreshed Software Operating Systems Open a window using PHP and maintain its active state.

Open a window using PHP and maintain its active state.

Open a window using PHP and maintain its active state.

9
905xA
Senior Member
667
12-17-2023, 04:54 AM
#1
You're looking to automate starting a screen on another user's Ubuntu server after a PHP script finishes. The current approach uses `exec` with sudo, which works but feels a bit clunky. Here are some alternatives:

- Use `systemctl start` or `service` commands if the screen is managed via systemd.
- Consider running the script in a dedicated service or using a tool like `screen`/`tmux` for persistent sessions.
- If the script needs to keep running, you might need to adjust its exit condition or use a process manager.

Let me know if you'd like help refining the script or setting up a persistent session!
9
905xA
12-17-2023, 04:54 AM #1

You're looking to automate starting a screen on another user's Ubuntu server after a PHP script finishes. The current approach uses `exec` with sudo, which works but feels a bit clunky. Here are some alternatives:

- Use `systemctl start` or `service` commands if the screen is managed via systemd.
- Consider running the script in a dedicated service or using a tool like `screen`/`tmux` for persistent sessions.
- If the script needs to keep running, you might need to adjust its exit condition or use a process manager.

Let me know if you'd like help refining the script or setting up a persistent session!

T
TheNiceHacks
Junior Member
25
12-17-2023, 06:29 AM
#2
You can remove the script from the process list with "disown".
T
TheNiceHacks
12-17-2023, 06:29 AM #2

You can remove the script from the process list with "disown".

Y
yesmat
Junior Member
3
12-26-2023, 09:00 AM
#3
Run the command you specified to launch a screen and detach afterward.
Y
yesmat
12-26-2023, 09:00 AM #3

Run the command you specified to launch a screen and detach afterward.

M
MrYoloHD123
Junior Member
2
12-26-2023, 05:54 PM
#4
Could we modify the command to include nohup while using exec?
M
MrYoloHD123
12-26-2023, 05:54 PM #4

Could we modify the command to include nohup while using exec?