Summary
Part of a 6-phase roadmap (see #1005 for Phase 1 and the full roadmap list).
Ships a generalized, distro-agnostic /etc/profile.d/fog.sh with shortcuts
for common admin tasks (updating, tailing logs), generalized from a personal
RHEL/site-specific alias file, so less-experienced Linux admins have an easy
on-ramp when asked for details/logs.
Design
- New function
installProfileAliases(), called near the end of the main
install flow (alongside installUtilities), rendering
/etc/profile.d/fog.sh via a heredoc using the install's own resolved
paths ($fogprogramdir, $fog_git_path from Phase 1, $webdirdest,
$servicelogs) -- no hardcoded distro-specific or site-specific paths.
- Always regenerate the file fresh on install/update (it's fully derived, not
meant to be hand-edited) -- safe and idempotent, same spirit as
linkIfAbsent()'s re-run guarantee elsewhere in this codebase.
- Alias set, generalized from a personal
fog.profile.sh down to what FOG
itself manages:
fogupdate -> bash $fog_git_path/bin/updatefog.sh (Phase 1)
cdfog -> cd $fog_git_path
cdfogweb -> cd $webdirdest
fogupdatelog -> tail -n 200 -f $servicelogs/fogupdate.log (Phase 1's log)
fogerrorlog -> tail -n 200 -f $apacheerrlog (FOG's own
per-distro-resolved web error log path, not a hardcoded php-fpm path)
- Dropped, not generalized: the Arrowhead-specific PowerShell
image-branch-promotion aliases, and the raw mysql -u root fog shortcut
(assumes passwordless root -- not a safe default to ship broadly).
- No further wiring needed --
/etc/profile.d/*.sh is sourced automatically
by login shells.
Files touched
lib/common/functions.sh (new installProfileAliases() + call site)
Verification
- Fresh install, open a new login shell, confirm all aliases are present and
each resolves to a correct path for that install.
- Test on at least one apt-based and one dnf-based distro to confirm the web
error log path resolves correctly per distro.
- Re-run install/update and confirm the file is cleanly regenerated with no
duplicated or stale entries from a prior install path.
Summary
Part of a 6-phase roadmap (see #1005 for Phase 1 and the full roadmap list).
Ships a generalized, distro-agnostic
/etc/profile.d/fog.shwith shortcutsfor common admin tasks (updating, tailing logs), generalized from a personal
RHEL/site-specific alias file, so less-experienced Linux admins have an easy
on-ramp when asked for details/logs.
Design
installProfileAliases(), called near the end of the maininstall flow (alongside
installUtilities), rendering/etc/profile.d/fog.shvia a heredoc using the install's own resolvedpaths (
$fogprogramdir,$fog_git_pathfrom Phase 1,$webdirdest,$servicelogs) -- no hardcoded distro-specific or site-specific paths.meant to be hand-edited) -- safe and idempotent, same spirit as
linkIfAbsent()'s re-run guarantee elsewhere in this codebase.fog.profile.shdown to what FOGitself manages:
fogupdate->bash $fog_git_path/bin/updatefog.sh(Phase 1)cdfog->cd $fog_git_pathcdfogweb->cd $webdirdestfogupdatelog->tail -n 200 -f $servicelogs/fogupdate.log(Phase 1's log)fogerrorlog->tail -n 200 -f $apacheerrlog(FOG's ownper-distro-resolved web error log path, not a hardcoded php-fpm path)
image-branch-promotion aliases, and the raw
mysql -u root fogshortcut(assumes passwordless root -- not a safe default to ship broadly).
/etc/profile.d/*.shis sourced automaticallyby login shells.
Files touched
lib/common/functions.sh(newinstallProfileAliases()+ call site)Verification
each resolves to a correct path for that install.
error log path resolves correctly per distro.
duplicated or stale entries from a prior install path.