ec2_post_init
Populate STScI EC2 instances with ease
|
System functions. More...
Go to the source code of this file.
Functions | |
sys_check_admin () | |
Determine if the current user is root. More... | |
sys_user_push (name) | |
Lazily "become" another user. More... | |
sys_user_pop () | |
Restore caller environment after sys_user_push() More... | |
sys_platform () | |
Get system platform (Linux , Darwin , etc) More... | |
sys_arch () | |
Get system architecture (i386 , x86_64 , etc) More... | |
sys_user_home (user) | |
Get account home directory. More... | |
sys_reset_home_ownership (user) | |
Resets ownership of a user (after sys_user_push() /sys_user_pop() ) More... | |
sys_pkg_get_manager () | |
Get the system package manager. More... | |
sys_pkg_install (...) | |
Install a system package. More... | |
sys_pkg_update_all () | |
Update all system packages. More... | |
sys_pkg_installed (name) | |
Test if a system package is installed. More... | |
sys_pkg_clean () | |
Clean the system package manager's cache(s) More... | |
sys_initialize () | |
Install dependencies required by ec2_post_init More... | |
Variables | |
Exported String | HAVE_DNF = 0 |
System uses DNF package manager. More... | |
Exported String | HAVE_YUM = 0 |
System uses YUM package manager. More... | |
Exported String | HAVE_APT = 0 |
System uses APT package manager. More... | |
Exported String | HAVE_REDHAT = 0 |
System is based on Red Hat. More... | |
Exported String | HAVE_DEBIAN = 0 |
System is based on Debian. More... | |
Exported String | HAVE_UBUNTU = 0 |
System is based on Ubuntu. More... | |
Exported String | HAVE_ARCH = 0 |
System is based on Arch. More... | |
Exported String | HAVE_SUPPORT = 1 |
System is supported. More... | |
Exported String | USER = $name |
Exported String | _sys_user_home_old = '' |
Exported String | _sys_user_old = '' |
System functions.
Definition in file system.inc.sh.
sys_arch | ( | ) |
Get system architecture (i386
, x86_64
, etc)
architecture | string |
Definition at line 93 of file system.inc.sh.
sys_check_admin | ( | ) |
Determine if the current user is root.
true | if root |
1 | if not root |
Definition at line 39 of file system.inc.sh.
sys_initialize | ( | ) |
Install dependencies required by ec2_post_init
exit_code | value of sys_pkg_install() |
Definition at line 325 of file system.inc.sh.
sys_pkg_clean | ( | ) |
Clean the system package manager's cache(s)
Definition at line 305 of file system.inc.sh.
sys_pkg_get_manager | ( | ) |
Get the system package manager.
result | the path to the package manager |
Definition at line 148 of file system.inc.sh.
sys_pkg_install | ( | ... | ) |
Install a system package.
... | a variable length list of packages to install |
1 | if not supported |
exit_code | of system package manager |
Definition at line 244 of file system.inc.sh.
sys_pkg_installed | ( | name | ) |
Test if a system package is installed.
name | of a system package |
1 | if not supported |
1 | if package is NOT installed |
0 | if package is installed |
Definition at line 276 of file system.inc.sh.
sys_pkg_update_all | ( | ) |
Update all system packages.
1 | if not supported |
exit_code | of system package manager |
Definition at line 261 of file system.inc.sh.
sys_platform | ( | ) |
Get system platform (Linux
, Darwin
, etc)
platform | string |
Definition at line 80 of file system.inc.sh.
sys_reset_home_ownership | ( | user | ) |
Resets ownership of a user (after sys_user_push()
/sys_user_pop()
)
user | account to modify |
Definition at line 126 of file system.inc.sh.
sys_user_home | ( | user | ) |
Get account home directory.
This function returns the home directory defined in /etc/passwd unless name
is the caller's account; in which case it will use the value of $HOME
.
user | account to inspect |
home | directory path |
Definition at line 108 of file system.inc.sh.
sys_user_pop | ( | ) |
Restore caller environment after sys_user_push()
Definition at line 69 of file system.inc.sh.
sys_user_push | ( | name | ) |
Lazily "become" another user.
This sidesteps sudo's environment limitations allowing one to execute scripts on behalf of the named user. Anything modified while sys_user_push()
is active will need to have its ownership and/or octal permissions normalized. If name
does not exist it will be created.
name | the user to become |
Definition at line 53 of file system.inc.sh.
Exported String _sys_user_home_old = '' |
Definition at line 72 of file system.inc.sh.
Exported String _sys_user_old = '' |
Definition at line 73 of file system.inc.sh.
Exported String HAVE_APT = 0 |
System uses APT package manager.
Definition at line 18 of file system.inc.sh.
Exported String HAVE_ARCH = 0 |
System is based on Arch.
Definition at line 30 of file system.inc.sh.
Exported String HAVE_DEBIAN = 0 |
System is based on Debian.
Definition at line 24 of file system.inc.sh.
Exported String HAVE_DNF = 0 |
System uses DNF package manager.
Definition at line 12 of file system.inc.sh.
Exported String HAVE_REDHAT = 0 |
System is based on Red Hat.
Definition at line 21 of file system.inc.sh.
Exported String HAVE_SUPPORT = 1 |
System is supported.
Definition at line 33 of file system.inc.sh.
Exported String HAVE_UBUNTU = 0 |
System is based on Ubuntu.
Definition at line 27 of file system.inc.sh.
Exported String HAVE_YUM = 0 |
System uses YUM package manager.
Definition at line 15 of file system.inc.sh.
Exported String USER = $name |
Definition at line 63 of file system.inc.sh.