Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

My starting point would be rc.local.

share|improve this answer

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.

share|improve this answer
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.