In GBase 8a V8, installation, upgrades and service start/stop all had to run under root. In V95 every service runs under dbaUser — usually the gbase OS user — but a few environment-setup steps still need root-level privileges. That does not mean the literal root account: a sudo user works, and some sites never hand out the root password at all. On the China-domestically developed GBase 8a MPP database from GBASE, SetSysEnv.py is one of those steps.
Running SetSysEnv.py as a sudo user
[root@gbase_rh7_015 sudoers.d]# su - gbase
Last login: Mon Apr 24 09:36:53 CST 2023 on pts/0
[gbase@gbase_rh7_015 ~]$
[gbase@gbase_rh7_015 ~]$ sudo ./SetSysEnv.py --dbaUser=gbase
[gbase@gbase_rh7_015 ~]$ ll /tmp -rt
total 16
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-rtkit-daemon.service-YlG9uz
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-systemd-hostnamed.service-3p4q5h
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-cups.service-VLoG3n
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-colord.service-yCOKCU
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-systemd-localed.service-6y6vkP
drwx------ 2 root root 6 Apr 23 14:38 tracker-extract-files.0
-rw-rw-r-- 1 gbase gbase 9322 Apr 23 14:44 InstallTar_2023_04_23.log
drwx------ 3 root root 17 Apr 24 09:34 systemd-private-3f88f95c55d94f1080eb490fd66800bc-rtkit-daemon.service-qO71jJ
drwx------ 3 root root 17 Apr 24 09:34 systemd-private-3f88f95c55d94f1080eb490fd66800bc-cups.service-fhR0Cy
drwx------ 3 root root 17 Apr 24 09:34 systemd-private-3f88f95c55d94f1080eb490fd66800bc-colord.service-sKFAU5
-rw-r--r-- 1 root root 3297 Apr 24 09:37 SetSysEnv.log
[gbase@gbase_rh7_015 ~]$ tail /tmp/SetSysEnv.log
2023-04-24 09:37:31,733-root-INFO reference: ulimit -m, value: unlimited
2023-04-24 09:37:31,733-root-INFO exec cmd:su - gbase -c "ulimit -m"
2023-04-24 09:37:31,770-root-INFO exec cmd:su - gbase -c "ulimit -m",and return value:unlimited
2023-04-24 09:37:31,770-root-INFO Set system max memory size to end.
2023-04-24 09:37:31,770-root-INFO Set system virtual memory...
2023-04-24 09:37:31,770-root-INFO reference: ulimit -v, value: unlimited
2023-04-24 09:37:31,771-root-INFO exec cmd:su - gbase -c "ulimit -v"
2023-04-24 09:37:31,810-root-INFO exec cmd:su - gbase -c "ulimit -v",and return value:unlimited
2023-04-24 09:37:31,810-root-INFO Set system virtual memory to end
2023-04-24 09:37:31,811-root-INFO Modify system env end.
[gbase@gbase_rh7_015 ~]$
SetSysEnv.log is owned by root even though the command was launched from the dbaUser account through sudo. That is expected: the script applies the ulimit settings with elevated privileges, then re-reads them under dbaUser and logs unlimited for both max memory size and virtual memory before reporting Modify system env end.
Going forward, plan for a sudo-capable account instead of insisting on root on a gbase cluster: the environment setup for a gbase database needs elevated privileges, not a specific login name.
Top comments (0)