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.

Issue with go scrip running at startup.

Featured Replies

Hey everyone,

 

Basically I am trying to pass through the graphic driver to a docker to enable emby to access hardware accelleration.

I have found some instuctions for plex that run a treat to get the driver to appear so it can be passed through, except it is does not retain after a reboot of the server.

 

The instructions I had followed were: https://forums.unraid.net/topic/77943-guide-plex-hardware-acceleration-using-intel-quick-sync/

 

There was a step to update the /boot/config/go file with the following at the end:

modprobe i915

chmod -R 777 /dev/dri

My go file is as following:

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
#Setup drivers for hardware transcoding in Emby
modprobe i915
chmod -R 777 /dev/dri/

 

However this appear to not be running as the /dev/dri folder does not appear but sometimes does when the steps are running manually.

 

Has this changes with the latest release of  unraid 6.7.2?

Cheers,

Sean

 

  • Community Expert
20 minutes ago, SeanGoneWild said:

 

However this appear to not be running as the /dev/dri folder does not appear but sometimes does when the steps are running manually.

What do you  mean by this "sometimes"?  IF it does not always work when you run it manually, why would you expect it to work in a script environment?  

  • Author

By sometimes I mean modprobe gives me a fatal error, this happends liturally once every 20 times I reboot. So I am unable to provide the error message.

 

But my question still remains into why the go script is not executing the script on boot?

Edited by SeanGoneWild

  • Community Expert

First thing, you need to trap the error code on exit.  (All proper behaving Linux commands will have an exit code on completion which 'tells' if it completed successfully.  A properly written BASH script should 'trap' this code and test it for proper execution if there is any possibility of failure.  OF course, it is up to the script writer to figure out a way to gracefully handle this.)    

 

What I also can't remember is exactly where the 'go' file executes in the boot process.   It could be that you are executing the modprobe command before the OS is fully installed.  

 

There is a plugin called 'CA User Scripts' which can be used to run user scripts.  It might be the solution to your problem.

 

You might also have to learn a bit of programing.  The shell used by Unraid is named BASH   (Bourne Again Shell)  and, if you google it, you can find tutorials to help you write a script for your use.  It is very powerful scripting language!  (The preclear script is written in BASH!)   These tutorials could also provide you with the knowledge of a way to integrate your commands (or call another 'script' from it) into the 'go' script and have it work. 

 

Now for the disclaimer.  It has been forty years since I had a course in Shell language and it was for the Bourne Shell.  (BASH came along in the late 1980's.)  I forgotten so much that I would be starting over in attempting to provide assistance in helping you write one. 

  • Community Expert
Just now, Frank1940 said:

Here is a instruction course in Bash:

 

 https://en.wikiversity.org/wiki/Bash_programming

It is worth pointing out that you can also write scripts in Unraid using PHP.   I have started using this in preference to bash as it provides far more facilities and is closer to traditional programming languages from a syntax perspective.

On 8/18/2019 at 8:57 AM, SeanGoneWild said:

Hey everyone,

 

Basically I am trying to pass through the graphic driver to a docker to enable emby to access hardware accelleration.

I have found some instuctions for plex that run a treat to get the driver to appear so it can be passed through, except it is does not retain after a reboot of the server.

 

The instructions I had followed were: https://forums.unraid.net/topic/77943-guide-plex-hardware-acceleration-using-intel-quick-sync/

 

There was a step to update the /boot/config/go file with the following at the end:

modprobe i915

chmod -R 777 /dev/dri

My go file is as following:


#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
#Setup drivers for hardware transcoding in Emby
modprobe i915
chmod -R 777 /dev/dri/

 

However this appear to not be running as the /dev/dri folder does not appear but sometimes does when the steps are running manually.

 

Has this changes with the latest release of  unraid 6.7.2?

Cheers,

Sean

 

It should be like this. You want modules loaded (and permissions changed) before the array is started (which will then start dockers and VMs)

#!/bin/bash
# enable iGPU for docker use
/sbin/modprobe i915
chmod -R 0777 /dev/dri
# Start the Management Utility
/usr/local/sbin/emhttp &

These are discussed in the varius plex/emby support threads

@ken-ji, did a fresh setup of another unraid box.  Can't get the emby gpu transcoding to work.  Using Intel Celeron G3930.  Already did the following:

 

#!/bin/bash

# enable iGPU for docker use

/sbin/modprobe i915

chmod -R 0777 /dev/dri

# Start the Management Utility

/usr/local/sbin/emhttp &

 

Does anything have to be done with Emby server?

 

Thanks in advance.

 

 

  • 2 weeks later...
  • Author
On 8/20/2019 at 3:49 PM, ken-ji said:

It should be like this. You want modules loaded (and permissions changed) before the array is started (which will then start dockers and VMs)


#!/bin/bash
# enable iGPU for docker use
/sbin/modprobe i915
chmod -R 0777 /dev/dri
# Start the Management Utility
/usr/local/sbin/emhttp &

These are discussed in the varius plex/emby support threads

Cheers  @ken-ji.

 

Ammended my go file and rebooted my unraid server, it is now working correctly.

 

Thanks,

Sean

On 8/25/2019 at 9:25 AM, jang430 said:

@ken-ji, did a fresh setup of another unraid box.  Can't get the emby gpu transcoding to work.  Using Intel Celeron G3930.  Already did the following:

 

#!/bin/bash

# enable iGPU for docker use

/sbin/modprobe i915

chmod -R 0777 /dev/dri

# Start the Management Utility

/usr/local/sbin/emhttp &

 

Does anything have to be done with Emby server?

 

Thanks in advance.

 

 

Yes, have Emby Premiere and turn on Hardware Transcoding in Emby. Set it to Advanced to see if the iGPU is correctly setup

image.thumb.png.e6e558171ce0c52771410d9e379defa9.png

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.