The HAD and Sybase Agent processes's extra long PATH environment variable was inherited from the user shell where VCS daemon was started. (hastart)
The user performed some maintenance operations and changed the PATH variable during the time and then restarted VCS. The changed PATH variable was inherited by the VCS/Agent processes. Sybase failed to online when the extra long PATH variable was inherited by the Sybase startserver program through the VCS Sybase Agent process.
Below testing shows how the user shell PATH environment can be inherited by the VCS SybaseAgent process.
---------------------------------------------------------------------------------
The environment variables are inherited by all the related VCS processes when VCS daemon (HAD) is restared. This includes the VCS Sybase agent process.
If the system boots up afresh, then the processes will have clean environment variables.
------------------------------------------------------
# echo $PATH <<<<<<<user shell PATH variable which is set to extra long
/usr/sbin:/usr/bin:/etc/vx/bin:/usr/share/webconsole/bin:/sbin:/usr/lib/fs/vxfs/bin:/usr/lib/vxvm/bin:/usr/lib/vxvm/voladm.d/bin:
/usr/openwin/bin:/usr/perl5/bin:/opt/VRTS/bin:/opt/VRTSvlic/bin:/opt/VRTSperl/bin:/opt/VRTSob/bin:/opt/VRTSob/jre/bin:
/opt/VRTSvxvm/vmcvt/bin:/opt/VRTSfspro/bin:/opt/VRTSalloc/bin:/opt/VRTSvcs/vxfen/bin:/opt/VRTSvcs/bin:
/opt/VRTSvcs/wizards/bin:/opt/VRTSweb/bin:/opt/VRTScssim/bin:/opt/VRTSvail/bin:/opt/VRTSdb2ed/bin:/etc/vx/diag.d:
/opt/VRTSspt/FS/MetaSave:/opt/VRTS/bin:/opt/VRTSspt/FS/VxBench
# pargs -e 4062
4062: /opt/VRTSvcs/bin/had <<<<<<had process
envp[0]: EAT_CATALOG_DIR=/opt/VRTSvcs
envp[1]: EAT_HOME_DIR=/opt/VRTSvcs
envp[2]: PWD=/var/VRTSvcs/diag/had
envp[3]: VCS_DIAG=/var/VRTSvcs
envp[4]: VCS_LOG=/var/VRTSvcs
envp[5]: VCS_CONF=/etc/VRTSvcs
envp[6]: VCS_HOME=/opt/VRTSvcs
envp[7]: LD_LIBRARY_PATH=/opt/VRTSvcs/lib:
envp[8]: PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/sbin:/usr/bin:/opt/VRTSvcs/bin <<<<<<<the clear PATH variable
envp[9]: SMF_FMRI=svc:/system/vcs:default
envp[10]: SMF_METHOD=/lib/svc/method/vcs start
envp[11]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[12]: TZ=PRC
# hastop -local –force <<<<<<restart HAD on this session
# hastart
# pargs -e 9617 <<<<<check the HAD process again after restarted.
9617: /opt/VRTSvcs/bin/had
envp[0]: EAT_CATALOG_DIR=/opt/VRTSvcs
envp[1]: EAT_HOME_DIR=/opt/VRTSvcs
envp[2]: VCS_DIAG=/var/VRTSvcs
envp[3]: VCS_LOG=/var/VRTSvcs
envp[4]: VCS_CONF=/etc/VRTSvcs
envp[5]: VCS_HOME=/opt/VRTSvcs
envp[6]: HOME=/
envp[7]: HZ=100
envp[8]: LD_LIBRARY_PATH=/opt/VRTSvcs/lib:
envp[9]: LOGNAME=root
envp[10]: MAIL=/var/mail/root
envp[11]: MANPATH=:/usr/share/man:/opt/VRTS/man:/opt/VRTSvlic/man:/opt/VRTSob/jre/man:/opt/VRTSdb2ed/man:/opt/VRTSd2gui/man
envp[12]: PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/sbin:/usr/bin:/etc/vx/bin:/usr/share/webconsole/bin:/sbin:/usr/lib/fs/vxfs/bin:/usr/lib/vxvm/bin:
/usr/lib/vxvm/voladm.d/bin:/usr/openwin/bin:/usr/perl5/bin:/opt/VRTS/bin:/opt/VRTSvlic/bin:/opt/VRTSperl/bin:/opt/VRTSob/bin:
/opt/VRTSob/jre/bin:/opt/VRTSvxvm/vmcvt/bin:/opt/VRTSfspro/bin:/opt/VRTSalloc/bin:/opt/VRTSvcs/vxfen/bin:/opt/VRTSvcs/bin:/opt/VRTSvcs/wizards/bin:
/opt/VRTSweb/bin:/opt/VRTScssim/bin:/opt/VRTSvail/bin:/opt/VRTSdb2ed/bin:/etc/vx/diag.d:/opt/VRTSspt/FS/MetaSave:
/opt/VRTS/bin:/opt/VRTSspt/FS/VxBench <<<<The PATH is inherited from user shell.
----------------------------------------------------------------------------
Below testing showed the Sybase "startserver" having issue if PATH variable was too long.
If the PATH variable is more then 2045 characters, then Sybase startserver program will fail to start the Sybase database server.
---------------------------------------------------------------------
The issue is reproduced in the following way. The Sybase "startserver" fails to start the Sybase database server if the PATH variable is too long.
# su dbuser
$ . /export/home/sybase/SYBASE.sh
$ PATH=$PATH:very_long_path_variable:...... # set the PATH environment variable to have more than 2048 characters
$ echo $PATH
$ echo $PATH | wc
$ /export/home/sybase/ASE-15_0/install/startserver -f /export/home/sybase/ASE-15_0/install/RUN_SYB1
---------------------------------------------------------------------