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.

Go directory instead of script hacking

Featured Replies

You might want to start a dedicated thread regarding "swap" files, etc.

 

To get back to the original topic.

 

I've added the "default" logic to my unmenu.awk package-manager plug in to install as appropriate one of either:

 

A single line, appended to the "/boot/config/go" script to install the designated packages upon reboot

or

A new S10-install_custom_packages file in the /boot/custom/etc/rc.d directory.

 

If the /boot/custom/etc/rc.d directory exists, the new file containing a one line command to install the designated packages is created.

 

If the /boot/custom/etc/rc.d directory does not exist, a line is appended to the "go" script.

 

A line is not appended if it already exists...  In the same fashion, the file is not created again or appended to if it already  contains a line matching a pattern in the unmenu.conf file 

(basically, it looks for an un-commented line containing *.auto_install before appending/creating the file)

 

With this, those with scripts in place can keep them as is, or edit them as needed, but in both cases, when you mark a package for auto-re-install on re-boot, it will.

 

The one line I am adding to the "go" script, (or putting inthe file in the rc.d directory) is as follows

(the PACKAGE_DIRECTORY folder is also configurable if you are following your own standard ???, so the "cd" will be correct.):

cd /boot/packages ;find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c

 

The lines in the unmenu.conf file that define all this look like this:

PACKAGE_DIRECTORY      = /boot/packages

# if rc.d folder exists with startup scripts, create the file there.  If this directory does not exist,
# the auto install command is appended to the "go" script.
AUTO_INSTALL_DIRECTORY = /boot/custom/etc/rc.d
AUTO_INSTALL_FILE      = S10-install_custom_packages

AUTO_INSTALL_COMMAND   = cd %PACKAGE_DIRECTORY% ;find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c
# looking for a line with .auto_install that is not commented out.
AUTO_INSTALL_TEST      = grep '^[^#]*\.auto_install'

 

Anybody see any reasons this will not work?  It does not delete anything, it does not resolve dependencies, but it will re-install specified downloaded packages when you reboot. (those with an affiliated .auto_install script)

 

Joe L.

  • Replies 82
  • Views 17.3k
  • Created
  • Last Reply

It doesn't really matter if initramfs swaps out ... the main purpose of swap for this discussion is for stability of an unRAID server when you start adding applications to it.

  • Author

Thats definitely a main point of discussion but the reason i brought it up again was in direct relation to this thread, where do the files were disussing physically live. Thats still up for debate and it occured to me that there is a certain logic of it being on the cache drive.

 

The swap is relevant as its a driver for the cache drive location arguement which is fundamental to this thread.

 

Now i know people are going to post who cares or it can be anywhere but for the masses they dont want to think about it they want to know what works and is easy for them.

It doesn't really matter if initramfs swaps out ... the main purpose of swap for this discussion is for stability of an unRAID server when you start adding applications to it.

 

The reason I mention it is, stability is not assured if something overflows rootfs/initramfs.

The one line I am adding to the "go" script, (or putting inthe file in the rc.d directory) is as follows

(the PACKAGE_DIRECTORY folder is also configurable if you are following your own standard ???, so the "cd" will be correct.):

cd /boot/packages ;find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c

 

Is there a reason to

cd to the package directory then do a find on .

when you can do a

find ${PACKAGE_DIRECTORY} ....

 

It seems to me that if the cd fails the find is going to find anything down the current tree rather then having the find fail because it cannot traverse the directory supplied.

 

The one line I am adding to the "go" script, (or putting inthe file in the rc.d directory) is as follows

(the PACKAGE_DIRECTORY folder is also configurable if you are following your own standard ???, so the "cd" will be correct.):

cd /boot/packages ;find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c

 

Is there a reason to

cd to the package directory then do a find on .

when you can do a

find ${PACKAGE_DIRECTORY} ....

 

It seems to me that if the cd fails the find is going to find anything down the current tree rather then having the find fail because it cannot traverse the directory supplied.

 

I need to run the installpkg commands in /boot/packages folder anyway, or set an environment variable, so to keep the command line short I just "cd" there.  If it is not there, the package files and .auto_install files will not be either.  ;)

 

I think I'll do both, cd to the folder so the install scripts will find what they need, and also explicitly set the directory on the "find" command.

 

It is actually pretty easy, since all I need do is change the line in the unmenu.conf file to have a second "%PACKAGE_DIRECTORY% placeholder in place of "."  That "token" is replaced with the full path to the package directory dynamically when the command is added to the rc.d directory.

 

Actually, even easier... ( just thought of it as I was typing all this)

 

I can replace this:

AUTO_INSTALL_COMMAND  = cd %PACKAGE_DIRECTORY% ;find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c

with this:

AUTO_INSTALL_COMMAND  = cd %PACKAGE_DIRECTORY% && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c

 

Now, if the "cd" fails, the balance of the line is not executed at all.    Thanks for questioning the logic. ;D

 

Joe L.

I was going to suggest that, but I wanted to see why you were doing it in two steps.

I was going to suggest that, but I wanted to see why you were doing it in two steps.

 

It looks like this in the syslog (I currently have 5 packages configured for auto_install):

Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: Processing S10-install_custom_packages
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: + cd /boot/packages
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: + find . -name '*.auto_install' -type f -print
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: + sort
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: + xargs -n1 sh -c
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: Installing package file-4.21-i486-1...
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: PACKAGE DESCRIPTION:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file: file (a utility to determine file type)
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file: This is Ian F. Darwin's 'file' utility, used to identify files.
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file: Christos Zoulas has been file's maintainer since 1994.
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: Executing install script for file-4.21-i486-1...
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: Installing package infozip-5.52-i486-2...
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: PACKAGE DESCRIPTION:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: infozip: infozip (Info-ZIP's zip and unzip utilities)
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: infozip:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: infozip: zip is a compression and file packaging utility for Unix, VMS, MSDOS,
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: infozip: OS/2, Windows NT, Minix, Atari and Macintosh, Amiga and Acorn RISC OS.
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: infozip: It is analogous to a combination of the UNIX commands tar(1) and
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: infozip: compress(1) and is compatible with PKZIP (Phil Katz's ZIP). A
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: infozip: companion program (unzip(1L)), unpacks zip archives.
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: infozip:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: Executing install script for infozip-5.52-i486-2...
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: Installing package file-4.21-i486-1...
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: PACKAGE DESCRIPTION:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file: file (a utility to determine file type)
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file: This is Ian F. Darwin's 'file' utility, used to identify files.
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file: Christos Zoulas has been file's maintainer since 1994.
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: file:
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]: Executing install script for file-4.21-i486-1...
Oct 13 20:28:15 Tower S10-install_custom_packages[6640]:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: Installing package lsof-4.78-i486-1...
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: PACKAGE DESCRIPTION:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: lsof: lsof (list open files)
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: lsof:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: lsof: Lsof is a Unix-specific tool. Its name stands for "LiSt Open Files",
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: lsof: and it does just that. It lists information about files that are open
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: lsof: by the processes running on the system.
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: lsof:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: lsof: Victor A. Abell of Purdue University is the developer of lsof.
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: lsof:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: Installing package ntfs-3g-1.2216-i486-1McD...
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: PACKAGE DESCRIPTION:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g: Mount NTFS read-write in userspace - NTFS-3G 1.2216
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g: The NTFS-3G driver is an open source, freely available NTFS driver for
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g: Linux with read and write support. It provides safe and fast handling
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g: of the Windows XP, Windows Server 2003, Windows 2000 and Windows Vista
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g: file systems. Most POSIX file system operations are supported, with
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g: the exception of full file ownership and access right support.
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g: Homepage: http://www.ntfs-3g.org/
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: ntfs-3g: (Compiled by [email protected] on 18-Feb-2008)
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: Executing install script for ntfs-3g-1.2216-i486-1McD...
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: Installing package wget-1.11.4-i486-1...
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: PACKAGE DESCRIPTION:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: wget: wget (a non-interactive network retriever)
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: wget:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: wget: GNU Wget is a free network utility to retrieve files from the
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: wget: World Wide Web using HTTP and FTP, the two most widely used Internet
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: wget: protocols. It works non-interactively, thus enabling work in the
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: wget: background after having logged off.
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: wget:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: wget: The author of Wget is Hrvoje Niksic .
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: wget:
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: Executing install script for wget-1.11.4-i486-1...
Oct 13 20:28:16 Tower S10-install_custom_packages[6640]: 

 

I'll post the package manager plug-in shortly with version 1.0 of unmenu.awk.  (It has a few new surprises for everyone)  I want to add a download config file for apcupsd before I do, as it is a good example of a slackware package that would have multiple lines required in its installation for configuration in a unRAID server.

 

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.