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.

What's wrong with this go-script line?

Featured Replies

I thought this line wold launch cached.sh in the background and return to the command prompt but it doesn't....

 

nohup nice /boot/bin/cached.sh >/dev/null 2>&1 </dev/null &

 

Any ideas what is wrong ?

 

It worked on my system.

Do you have end of line correct?

 

root@unraid /boot/bin #nohup nice /boot/bin/cached.sh >/dev/null 2>&1 </dev/null & 

[1] 8979

root@unraid /boot/bin #ps -f

UID        PID  PPID  C STIME TTY          TIME CMD

root      8973  8971  0 09:00 pts/0    00:00:00 -bash

root      8979  8973  0 09:02 pts/0    00:00:00 /bin/bash /boot/bin/cached.sh

root      8980  8979  0 09:02 pts/0    00:00:00 sleep 300

root      8981  8973  0 09:02 pts/0    00:00:00 ps -f

 

in my go script and my cached.sh test script I have the following as the first line.

#!/bin/bash

I thought this line wold launch cached.sh in the background and return to the command prompt but it doesn't....

 

nohup nice /boot/bin/cached.sh >/dev/null 2>&1 </dev/null &

 

Any ideas what is wrong ?

 

Here's a hint....

Question.   What command was run?

Answer:      nohup

 

Question: How was the command invoked?

Answer:   The "nohup" command was run in the background.   The "nohup" command had its standard input, output, and stderr connected to /dev/null.

 

The nohup then runs "nice" which in turn then runs "bash" that interprets the script.

 

Last question... how are you invoking this line?  Are you running it on the command line, or passing it through "fromdos" and then sending it to a "sh" process?

 

A lot has to do with which command is actually being put in the background with the "&"

 

A different approach (and one I just learned myself) might be:

nice cached.sh &

disown %1

 

Joe L.

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.