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.

init script not working as expected

Featured Replies

Hello

 

So I was trying to adapt a plugin and it has this line in its rc start srcipt:

	CMDLINE="sudo -u $RUNAS tvheadend -c $DATADIR -u $RUNAS -g $GROUP -f 2>&1 >/dev/null"

$CMDLINE


  • I have the following questions:

  1. If the 2>&1 >/dev/null stuff is meaning to silence all output, stdout and stderr, doesn't it have to be  >/dev/null 2>&1 ??
  2. If I try either of those commands, the syslog says: see next post for #2

Sep  2 01:42:21 Server sudo:     root : TTY=pts/0 ; PWD=/etc/rc.d ; USER=root ; COMMAND=/usr/bin/tvheadend -c /mnt/cache/.apps/tvheadend -u root -g video -f > /dev/null 2>$stuff$1

and the command does not work properly. How can I avoid the $stuff$ ??

 

Thanks

 

  • Author

I came to the idea that the $stuff$ thing had something to do with the syslog formatting in unmenu - And I was right.

 

Anyway, there must be another reason why this does not work. The complete function looks like this.

 

tvheadend_start()
{
        # no-op if not enabled
        if [ $SERVICE != "enable" ]; then
                return
        fi

        # no-op if already running
        if [ -r /var/run/tvheadend.pid ]; then
                return
        fi

        # if directory doesn't exist or Tvheadend is not found, install it
        if [ ! -e "/usr/bin/tvheadend" ]; then
                tvheadend_install
        fi
        CMDLINE="sudo -u $RUNAS tvheadend -c $DATADIR -u $RUNAS -g $GROUP -f 2>&1 > /dev/null"
        echo "Starting Tvheadend: $CMDLINE"
        sleep 1
        $CMDLINE

        while [ ! -e /var/run/tvheadend.pid ]; do
                sleep 1
        done
        echo "... OK"
        sleep 1
}


Now when i invoke it via /etc/rc.d/rc.tvheadend start, i get an error and an description on how tvheadend is used

 

Starting Tvheadend: sudo -u root tvheadend -c /mnt/cache/.apps/tvheadend -u root -g video -f 2>&1 > /dev/null
Usage: tvheadend [OPTIONS]

Generic Options

  -h, --help                  Show this page
...........

And the script is stuck (because tvheadend.pid isn't created)

Now, when I abort the script and take that very codeline it echoed before "crashing" and paste it back in, it works...

Any idea about that? How can I "debug" something like this?

  • 2 weeks later...

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.