Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Linux question (detach console)

Featured Replies

I am pretty sure you can close your telnet connection and your tasks can keep going, right?

 

I remember this happening even when I was involved with Linux (read: kernel 0.8), but even today I read about some "screen" command.

 

Is any such capability in unRAID?

If not, is it easily installed? (go script package)

 

How would I use it then?

 

Just occurred to me, that I will have to telnet over to my unRAID, using my VPN connection from work, so that I can kickstart the next step of my migration, while I am not at home. But that "step" will probably take hours, so I'll have to leave the session open and even if I do (and I can make sure nobody touches my computer), I will not know when that "step" finished (when I am back at home)...

 

So, is there a way to start it remotely, leave it doing its stuff and then going back to home, opening a terminal and seeing the same console?

 

 

Temporarily Install the following packages with installpkg

 

http://packages.slackware.it/package.php?q=current/aaa_terminfo-5.6-noarch-1

http://packages.slackware.it/package.php?q=current/utempter-1.1.4-i486-1

http://packages.slackware.it/package.php?q=current/screen-4.0.3-i486-1

 

Here's a brief usage

after installed,

run screen, you will get a new shell session.

 

run your command.

 

Then press

CTRL-a then d

This will detach you,

 

you will see

[detached]

 

 

you can logoff and logon elsewhere

 

to re-attach

type

 

screen -r

 

this will bring back the other session.

 

to end and terminate the screen session

type

exit

at the prompt.

tyou will see

[screen is terminating]

 

You can open a number of windowed sessions,

Here's a brief help screen from the command line

 

Do an online search for a tutorial or the manpage of screen for more information.

 

 

[screen is terminating]

root@unraid:/mnt/user/pub/slackware# screen -h

Use: screen [-opts] [cmd [args]]

or: screen -r [host.tty]

 

Options:

-a            Force all capabilities into each window's termcap.

-A -[r|R]    Adapt all windows to the new display width & height.

-c file      Read configuration file instead of '.screenrc'.

-d (-r)      Detach the elsewhere running screen (and reattach here).

-dmS name    Start as daemon: Screen session in detached mode.

-D (-r)      Detach and logout remote (and reattach here).

-D -RR        Do whatever is needed to get a screen session.

-e xy        Change command characters.

-f            Flow control on, -fn = off, -fa = auto.

-h lines      Set the size of the scrollback history buffer.

-i            Interrupt output sooner when flow control is on.

-l            Login mode on (update /var/run/utmp), -ln = off.

-list        or -ls. Do nothing, just list our SockDir.

-L            Turn on output logging.

-m            ignore $STY variable, do create a new screen session.

-O            Choose optimal output rather than exact vt100 emulation.

-p window    Preselect the named window if it exists.

-q            Quiet startup. Exits with non-zero return code if unsuccessful.

-r            Reattach to a detached screen process.

-R            Reattach if possible, otherwise start a new session.

-s shell      Shell to execute rather than $SHELL.

-S sockname  Name this session <pid>.sockname instead of <pid>.<tty>.<host>.

-t title      Set title. (window's name).

-T term      Use term as $TERM for windows, rather than "screen".

-U            Tell screen to use UTF-8 encoding.

-v            Print "Screen version 4.00.03 (FAU) 23-Oct-06".

-wipe        Do nothing, just clean up SockDir.

-x            Attach to a not detached screen. (Multi display mode).

-X            Execute <cmd> as a screen command in the specified session.

 

Can't you use "nohup" and get a command to run in the background with plain vanilla unRAID?

Can't you use "nohup" and get a command to run in the background with plain vanilla unRAID?

Of course, but then you cannot get the same session back, Unless a logfile is sufficient.

 

So, is there a way to start it remotely, leave it doing its stuff and then going back to home, opening a terminal and seeing the same console?

I took this request as a request to do something at an interactive session  console, detach, go somewhere else or return and get the same session console back.

 

 

Nohup is truly simpler. (and part of the shell)

You can run your command like.

 

nohup somecommand_to_run_in_background &

 

The & will run the command in the background.

the nohup will not kill the command when you exit(hang up or "hup).

 

All output will be logged to a file called nohup.out where ever you ran the command.

Then you can check the status of your command with less nohup.out.

You can monitor it in realtime with tail -f nohup.out.

 

You cannot get the terminal session of that command back to your screen or interact with it directly any more after the nohup.

If you want to abort the command you will need to do a ps -ef | less to find the programs pid then kill it.

 

 

Thanks for the refresher. I had forgotten how nohup works.

 

So if I have a bunch of files I'd like to move from disk2 to disk3 overnight, I can enter the command ...

 

nohup mv /mnt/disk2/Videos/* /mnt/disk3/Videos &

 

from a telnet session.

 

I can then exit the telnet session, and it will keep running until it is finished and then the background process will end. Right?

Correct. you can check the log nohup.out the next time you login.

  • Author

How will the command I run with nohup show in process tree?

 

I mean, if I can start it, then check the process tree for when the command will be finished (usually an rsync), it is good enough.

 

The nohup log will be a problem if you talk about copying 300000 files.

 

About the three installed packages, do they take much storage/RAM? This is why you say about temporary installing them?

 

 

  • Author

Reply to myself: yes shows in ps -x fine and stops showing when finished. Good enough. :)

 

Still didn't get the part with the log (didn't see a log in my cd). EDIT: Now I see a log. Maybe it is just there while the process runs?

 

Also please tell me about the packages as asked above.

 

 

> About the three installed packages, do they take much storage/RAM? This is why you say about temporary installing them?

 

root@unraid:/mnt/user/pub/slackware# du -hs screen_root/

2.2M    screen_root/

 

Unpackaged they should take about 2M of storage.

Keeping them around permanently depends on how often you will use them.

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.