Skip to content

Where/how to install user scripts and tools #239

Answered by Jip-Hop
jonct asked this question in Q&A
Discussion options

You must be logged in to vote

What do you think of this as a general solution?

Post Init Command:

mkdir -p /root/usr-local-bin && mount -o remount,rw /usr && mount -t overlay overlay -o lowerdir=/root/usr-local-bin:/usr/local/bin /usr/local/bin; mount -o remount,ro /usr

This will temporarily remount /usr as read-write, then overlay mount /root/usr-local-bin underneath /usr/local/bin and remount /usr back as readonly as if nothing happend. Put your executables inside /root/usr-local-bin and they shall be available globally for any user, including for use with sudo.

Since /usr/local/bin is the last dir in the default secure_path it can't override any of the commands in directories that come before it. Since /root/usr-lo…

Replies: 3 comments 40 replies

Comment options

You must be logged in to vote
16 replies
@Lockszmith-GH
Comment options

@jonct
Comment options

@Lockszmith-GH
Comment options

@Lockszmith-GH
Comment options

@jonct
Comment options

Comment options

You must be logged in to vote
16 replies
@Jip-Hop
Comment options

@jonct
Comment options

@Jip-Hop
Comment options

@jonct
Comment options

@Jip-Hop
Comment options

Comment options

You must be logged in to vote
8 replies
@Jip-Hop
Comment options

@jonct
Comment options

@Jip-Hop
Comment options

@Lockszmith-GH
Comment options

@jonct
Comment options

Answer selected by Jip-Hop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants