0

Some times, after a reboot, some of my apps that have a GUI close. These apps provide web interface as well, but only if their gui potion is open. If the unit is physically available to me, I can start a screen with the screen command, detach from it and if i ever need to open anything else that requires a gui, I can reconnect to that same screen to achieve the task. IE > while on the server (physically)

screen -S display

then, I can be on any computer (remotely via ssh)

screen -r display
transmission-gtk&

The above code then would open transmission-gtk

but, if i dont have a screen attached to the physical machine, transmission-gtk will output

error, no display attached.

Note: I know there are commandline transmission as well as most other apps. however, this is the way I want to do it.

So here is the question! How to I create that "screen" on boot. Which RC do I put it in.

Thanks

user1048138
  • 135
  • 2
  • 2
  • 7

3 Answers3

0

My starting point would be rc.local.

rlduffy
  • 241
  • 1
  • 4
0

I think the "error, no display attached" happens because you are trying to start a GUI program from a screen terminal. I could be wrong, but as far as I know, screen has no connection to GUI displays.

But to answer your question, @rlduffy's suggestion of using rc.local is a good place to start. You would need to add a line to the rc.local like the following that would start the screen process in detached mode:

/bin/su --login -c "/usr/bin/screen -d -m -t myscreen /bin/sh -c command_you_want_to_run" preferred_useracct

Since rc.local runs after all other start-up processes, there no longer is a question of which RC level to use. You can use screen -r myscreen to reattach to your detached screen processs.

ZaSter
  • 339
  • 4
  • 11
0

Okay. It has been a while, but here is the "part" solution.

If on the desktop, I start a terminal session and start a screen. That newly made terminal session/screen has access to x11 stuff.

Therefore, I can launch transmission-gtk or whatever from the command line by sshing in and reattaching the screen.

Please add to this if you find a way to start the screen from the gui on boot.

user1048138
  • 135
  • 2
  • 2
  • 7