RH7/Centos7 and recent versions of fedora relocate `/*bin/*` into `/usr/*bin/`. This causes
conflicts for upgrades against xCAT-genesis-scripts-* packages which expect the `/bin` a to be
a directory while `xCAT-genesis-base-*` packages provide a link. Relocating all files into `/usr`
fixes that conflict and allows a clean upgrade from all old versions.
Changes:
- Explicit shebang (make it explicit). It not required but clarifies syntax used.
- ShellCheck suggested fixes.
- Correct mirroring of `doxcat` to first physical cons if serial cons is primary.
- Add protection for accidental closure of primary screen.
- Minor optimizations
Since commit 1219fdd23fb8602bb1029b96bb69cf4d746f0029, the rsyslog rule
"*.debug /var/log/messages" is no longer added to rsyslog.conf on the
MN. However, any rule ending with "/var/log/messages" is still commented
out. This leads to xCAT removing all output to /var/log/messages, except
for the daemon and ftp facilities that are enabled by
/etc/rsyslog.d/xcat-debug.conf!
This commit
- stops commenting out rules ending with "/var/log/messages" in
rsyslog.conf
- stops adding adding the comment "#*.debug /var/log/messages" to
rsyslog.conf
- changes "daemon.debug" to "daemon.=debug" in xcat-debug.conf to avoid
duplicate daemon log lines with most Linux distributions' default
rsyslog.conf.
The 'ftp.* rule in xcat-debug.conf is possibly no longer needed, and
will lead to duplicate ftp messages with most distributions, but it is
left untouched in this commit.
Previously, it is impossible to know if the goconerver is started
by xcat. This patch add a marker in /etc/goconserver/server.conf
to help check the status. In addition, use server-cred.pem instead
of server-key.pem as it is not exist on SN.
This patch also control the service status of goconserver and conserver
when restarting the xcatd service on service node.
```
[root@sn02 ~]# chdef sn02 setupconserver=1
1 object definitions have been created or modified.
[root@sn02 ~]# service xcatd restart
Restarting xcatd (via systemctl): [ OK ]
[root@sn02 ~]# ps -ef | grep conserver
root 27679 1 0 02:26 ? 00:00:00 /usr/sbin/conserver -o -O1 -d
root 27680 27679 0 02:26 ? 00:00:00 /usr/sbin/conserver -o -O1 -d
root 27756 26188 0 02:26 pts/1 00:00:00 grep --color=auto conserver
[root@sn02 ~]# chdef sn02 setupconserver=2
1 object definitions have been created or modified.
[root@sn02 ~]# service xcatd restart
Restarting xcatd (via systemctl): [ OK ]
[root@sn02 ~]#
[root@sn02 ~]#
[root@sn02 ~]#
[root@sn02 ~]# ps -ef | grep conserver
root 27885 1 0 02:26 ? 00:00:00 /usr/bin/goconserver
root 27986 26188 0 02:33 pts/1 00:00:00 grep --color=auto conserver
```