Less than successful: mc as a daemon

Sometimes I try things that sound good while they’re bouncing around in my brain, but after they’re done, I wonder why I bothered.

A long time ago, someone posted a method for trapping rtorrent in screen session and running it as a daemon. Attaching to the screen session gave normal users a way of controlling it.

Detaching from screen meant it continued to run in the background, so long as it wasn’t told outright to quit. And since it started as a system service, just turning on the machine put it into action.

At the same time, I banged around with mc about nine months ago, trying to force it into tty1 instead of getty.

The goal there was similar — to start up an application with the system, devote a single virtual console to it, and allow the user to bounce back and forth to that tty as a means of running it.

Last week during my forced hiatus, I tried a hybrid of those two, and more or less managed to run mc as a daemon, also within screen and with it triggered at bootup.

It wasn’t quite successful though (you probably guessed that, didn’t you?). In the time that has elapsed since the original post about rtorrent-plus-screen, things seem to have changed in the way those things work.

To summarize, I couldn’t get the ownership issues sorted out. The autostarting instance of screen was for some reason invisible to a normal user, which of course defeated the purpose.

Trying to shift the burden to tty1 only confused things. screen balked, and my configurations were somehow inaccessible.

Without a .screenrc that I could cue, tty1 opened up as a vanilla screen session, and then refused to budge beyond the welcome message.

Of course, after all was said and done, I began to wonder why I was bothering with the idea at all. Midnight Commander is a tiny little program that runs fine on every machine in the house.

And I couldn’t even use the excuse that it was somehow easier to invoke that way, since you can start mc with three keystrokes. :roll:

Short of assigning a custom keypress to the mc command, it doesn’t get much simpler than m-c-Enter.

Still, science demanded an answer. Unfortunately, this time my answer was gibberish. :|

About these ads

3 Responses to “Less than successful: mc as a daemon”


  1. 1 jeremiah 2011/05/24 at 10:51 PM

    for those thinking about trapping single programs within a “screen” session, look into “dtach”: this is dtach’s sole purpose so it’s much lighter than having several screen sessions running.

    I have several programs that are usually running in their own dtach sessions: irssi, rtorrent, mutt.

    • 2 jeremiah 2011/05/24 at 11:02 PM

      Here’s a quick example of a script to connect to a detached irc session (or create a new one if one doesn’t already exist):

      #!/bin/sh

      IRC_COMMAND=”irssi”
      DTACH_SOCKET=”/tmp/${USER}-irc”

      if [ -S $DTACH_SOCKET ]; then
      dtach -a $DTACH_SOCKET -r winch
      else
      dtach -c $DTACH_SOCKET -z $IRC_COMMAND
      fi

      # Should be easy to see how to change this as needed edit as needed… to dtach from a session, you hit Ctrl-\.

  2. 3 Christian Neukirchen 2011/06/03 at 10:58 AM

    Try openvt? Also can bind to a vt.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,962,940 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: