Jump to content

Shell customization on PMSS

From Pulsed Media Wiki


Direct edits to ~/.bashrc on a Pulsed Media seedbox do not survive a platform update — PMSS manages that file and restores it from its template. Put your own aliases, environment variables, and functions in ~/.bashrc.user instead. That file is sourced on every login and is never overwritten.

Why your .bashrc changes disappear

~/.bashrc is a platform-managed file. Every time PMSS updates runs, it compares your ~/.bashrc against the current template and replaces yours whenever the two differ. Editing the file is itself what makes it differ, so your change is put back to the template version on the very next update run — you do not have to wait for the template to change. Nothing warns you first.

This is deliberate. Keeping the base file under platform control is what lets a security fix or a PATH correction reach every account at once.

Where to put your changes: ~/.bashrc.user

The base ~/.bashrc ends by loading two optional files, if they exist. One of them, ~/.bashrc.user, is reserved for you. It does not exist by default — create it, and it loads automatically.

# create and edit the file
nano ~/.bashrc.user

# for example:
alias ll='ls -alF'
export EDITOR=nano

# apply it to your current session without logging out
source ~/.bashrc.user

New login shells pick it up on their own. Because ~/.bashrc.user is not part of the managed set, updates leave it alone — your customizations stay put.

One caveat: ~/.bashrc only runs in interactive shells, so anything in ~/.bashrc.user loads for your SSH sessions but not for non-interactive contexts such as cron jobs or bash -c commands. A variable that a script or cron job needs should be set inside that script, not here.

The three files, and which one is yours

File Owner Survives an update?
~/.bashrc PMSS (platform) No — restored from template
~/.bashrc.custom PMSS installers (e.g. the media-stack installer) Yes
~/.bashrc.user You Yes

Both .custom and .user survive updates, but they are not interchangeable. ~/.bashrc.custom is where PMSS installer scripts write their own additions, so putting your personal config there risks a collision the next time an installer touches it. Use ~/.bashrc.user for anything you write by hand.

A note on PATH

Both extension files are loaded at the very end of ~/.bashrc, after PMSS has already built your PATH. PMSS appends your personal ~/bin and ~/.bin directories after the system directories on purpose: a program you place in your own ~/bin cannot silently shadow a system command like sudo or passwd. If you add a PATH line in ~/.bashrc.user, it runs after that ordering is set, so you can prepend your own directory if you want to — just understand that doing so overrides that safeguard in your own shell.

See also