March 18, 201016 yr I've got no idea... One difference I can think of is the search PATH used for commands might be different. (Causing the shell to traverse different directories when looking for the commands to run) My cache_dirs lives in /boot/custom/bin. I invoke it like this in my "go" script. my drives spin down just fine. I add /boot/custom/bin to the execution path in the "go" script. (This is my whole "go" script.) #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & PATH=$PATH:/boot/custom/bin cache_dirs -w -e Pictures -e data -d 3 fromdos < /boot/custom/bin/powerdown > /sbin/powerdown chmod u+x /sbin/powerdown fromdos < /boot/custom/etc/rc.d/S30-inittab-powerdown | sh fromdos < /boot/custom/etc/rc.d/rc.local_startup | sh echo "/boot/unmenu/uu" | at now + 1 minute I'm tring to figure out how to add a directory to the path but am having no luck. I found this example from Joe L. which is the exact directory I want added to my path but when I copy this line into my go script it does not seem to work. After rebooting /boot/custom/bin is not in my path. What do I needto do in order to get this working?
March 18, 201016 yr I've got no idea... One difference I can think of is the search PATH used for commands might be different. (Causing the shell to traverse different directories when looking for the commands to run) My cache_dirs lives in /boot/custom/bin. I invoke it like this in my "go" script. my drives spin down just fine. I add /boot/custom/bin to the execution path in the "go" script. (This is my whole "go" script.) #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & PATH=$PATH:/boot/custom/bin cache_dirs -w -e Pictures -e data -d 3 fromdos < /boot/custom/bin/powerdown > /sbin/powerdown chmod u+x /sbin/powerdown fromdos < /boot/custom/etc/rc.d/S30-inittab-powerdown | sh fromdos < /boot/custom/etc/rc.d/rc.local_startup | sh echo "/boot/unmenu/uu" | at now + 1 minute I'm tring to figure out how to add a directory to the path but am having no luck. I found this example from Joe L. which is the exact directory I want added to my path but when I copy this line into my go script it does not seem to work. After rebooting /boot/custom/bin is not in my path. What do I needto do in order to get this working? The reason it does not work for you is that you do not run the "go" script when you log in. A login shell gets its path from two places in linux. a system wide file /etc/profile and a user-specific file located in the user's home directory .profile The system wide file is evaluated first, then the user-specific one. The user-specific one does not currently exist in unRAID. If it did, it would exist as /root/.profile ( .profile in the home directory of the user logging in) To create the ".profile" file, we can add a line in the "go" script. Then, when we next log in, ".profile" will be evaluated and your PATH set. The line you need to add to the "go" file is: echo "PATH=$PATH:/boot/custom/bin" >/root/.profile Joe L.
March 18, 201016 yr Author Thank you, I would have NEVER figured that out on my own. If I also wanted to use the next line, cache_dirs, shown in the go script would I need something like this then? /usr/local/sbin/emhttp & PATH=$PATH:/boot/custom/bin echo $PATH >/root/.profile cache_dirs -w -i Videos
March 18, 201016 yr Thank you, I would have NEVER figured that out on my own. If I also wanted to use the next line, cache_dirs, shown in the go script would I need something like this then? /usr/local/sbin/emhttp & PATH=$PATH:/boot/custom/bin echo $PATH >/root/.profile cache_dirs -w -i Videos No... close, but not quite The second line needs to be echo "PATH=$PATH" >/root/.profile Otherwise, what ends up in .profile is a line looking like this /usr/local/sbin:/usr/sbin:/sbin:./:/usr/local/bin:/usr/bin:/bin instead of this PATH=/usr/local/sbin:/usr/sbin:/sbin:./:/usr/local/bin:/usr/bin:/bin
March 18, 201016 yr Author Thank you, I would have NEVER figured that out on my own. If I also wanted to use the next line, cache_dirs, shown in the go script would I need something like this then? /usr/local/sbin/emhttp & PATH=$PATH:/boot/custom/bin echo $PATH >/root/.profile cache_dirs -w -i Videos No... close, but not quite The second line needs to be echo "PATH=$PATH" >/root/.profile Otherwise, what ends up in .profile is a line looking like this /usr/local/sbin:/usr/sbin:/sbin:./:/usr/local/bin:/usr/bin:/bin instead of this PATH=/usr/local/sbin:/usr/sbin:/sbin:./:/usr/local/bin:/usr/bin:/bin AH! Once again - THANK YOU
January 19, 20179 yr Hey sorry to dig this up from the graveyard, but I'm having trouble getting this to work. I have this in my go script: PATH=$PATH:/usr/lib64/jre1.8.0_45/bin echo "PATH=$PATH" > /root/.profile And when I login, my .profile shows the correct path, but if I actually check $PATH, it doesn't contain the directory I added. Am I missing some simple step?
Archived
This topic is now archived and is closed to further replies.