etc
/
rc.d
/
rc6.d
➕ New
📤 Upload
✎ Editing:
K50kav4fs-supervisor
← Back
#!/bin/sh ### BEGIN INIT INFO # Provides: kav4fs-supervisor # Required-Start: $local_fs # Required-Stop: # Should-Start: # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Kaspersky Lab Framework for Kaspersky Lab Linux-based anti-virus applications # Description: Provides a framework required to run Kaspersky Lab Linux-based # applications of version 8.0 and above. # Note: Starting the service starts all the Kaspersky Lab Linux-based anti-virus # applications of version 8.0 and above installed on this computer. # Stopping the service stops all the Kaspersky Lab Linux-based anti-virus # applications of version 8.0 and above running on this computer. ### END INIT INFO KL_APP=kav4fs KL_SERVICE_TITLE="Kaspersky Lab Framework Supervisor" KL_SERVICE_NAME=kav4fs-supervisor KL_SERVICE_BIN=/opt/kaspersky/kav4fs/sbin/kav4fs-supervisor KL_SERVICE_CONFIG=/etc/opt/kaspersky/kav4fs-supervisor.conf KLFW_CONTROL=/opt/kaspersky/kav4fs/sbin/kav4fs-supervisor-control . /opt/kaspersky/kav4fs/lib/rcfunctions.sh is_systemd() { ps -p 1 -o comm= | grep systemd >/dev/null 2>&1 if [ $? -eq 0 ] && [ -d '/etc/systemd/system' ]; then return 0 else return 1 fi } lock_subsystem() { if [ -d /var/lock/subsys ]; then touch "/var/lock/subsys/$KL_SERVICE_NAME" fi } unlock_subsystem() { if [ -d /var/lock/subsys ]; then rm -f "/var/lock/subsys/$KL_SERVICE_NAME" fi } INSTALLER_DAT="/var/opt/kaspersky/$KL_APP/installer.dat" LOCALE="$(kl_get_value "$INSTALLER_DAT" SERVICE_LOCALE)" if [ -z "$LOCALE" ] ; then if [ -d /etc/locale ] ; then for locale in en_US.utf8 en_US.UTF8 en_US.UTF-8 UTF-8 ; do if [ -d "/etc/locale/$locale" ] ; then LOCALE="$locale" break fi done else LOCALE="$(locale -a|grep -ie 'en_US.UTF-\?8'|head -n 1)" fi [ -n "$LOCALE" ] || LOCALE='C' fi export LANG=$LOCALE export LC_ALL=$LOCALE # Reset status of this service kl_reset kl_run_dir=/var/run/kav4fs if [ ! -e "$kl_run_dir" ] ; then mkdir "$kl_run_dir" chmod 0750 "$kl_run_dir" fi case "$1" in start) kl_action "Starting" if ! $KLFW_CONTROL --start-supervisor ; then kl_setrc 1 fi kl_status -v $KLFW_CONTROL --supervisor-status && lock_subsystem ;; stop) kl_action "Shutting down" if ! $KLFW_CONTROL --stop-supervisor ; then kl_setrc 1 fi kl_status -v $KLFW_CONTROL --supervisor-status || unlock_subsystem ;; try-restart|condrestart) # Do a restart only if the service was active before. $0 status >/dev/null if test $? = 0; then $0 restart else kl_reset # Not running is not a failure. fi # Remember status and be quiet kl_status ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start # Remember status and be quiet kl_status ;; reload|force-reload) ## Like force-reload, but if daemon does not support ## signaling, do nothing (!) # If it supports signaling: #kl_action "Reload service" #kl_killproc $KL_SERVICE_BIN -HUP #kl_status -v ## Otherwise if it does not support reload: is_systemd rc=$? if [ $rc -eq 0 ]; then echo Option reload is not supported on systems with systemd exit 3 elif [ "$KL_OS" = 'suse' ] ; then rc_failed 3 kl_status -v else $0 restart fi ;; status) kl_action "Checking for service" kl_checkproc $KL_SERVICE_BIN kl_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 ;; esac kl_exit
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel