Novell Home

Adding a Service with rug if ZENworks already exists on a ZLM Server

Novell Cool Solutions: Feature

Digg This - Slashdot This

Posted: 17 Jul 2007
 

Environment:
SUSE Linux Enterprise Server 10
SUSE Linux Enteriprise Server 9
ZENworks Linux Management 7 IR1
ZENworks Linux Management 7.2
ZLM 7 IR1
ZLM 7.2

When attempting to add a service and register with a ZLM server you may get the following error message
ERROR: A service of type 'ZENworks' already exists on this client.

Once you get this message you are unable to add a service with rug.

The nice folks in Novell Support have created a script that lets you clear out the error from your system. This will save you a lot of steps -- so many thanks to NTS for this goodie.

Copy this script into your favorite editor and save as zlm_service_cleanup.sh or some other name if you prefer.

#!/bin/sh
#zlm_services_cleanup.sh
#This script will attempt to cleanup any Services related files that cause the following error message.
#ERROR: A service of type 'ZENworks' already exists on this client
#Once cleaned up you will need to add your service again with rug. See the comment section at the bottom of the script.

/etc/init.d/novell-zmd stop

function check_pid_file()
{
    test -f /var/run/zmd.pid
}

if check_pid_file == 0; then
    echo -e "Killing ZENworks Management Daemon. \n"
    kill -9 `cat /var/run/zmd.pid`
fi

echo -e "Removing all Services related files. \n"

rm /etc/opt/novell/zenworks/zmd/secret
rm /etc/opt/novell/zenworks/zmd/deviceid
rm /etc/opt/novell/zenworks/zmd/initial-service

rm -rf /var/opt/novell/zenworks/cache/zmd/web/files/*
rm -rf /var/opt/novell/zenworks/cache/zmd/web/info/*
rm -rf /var/opt/novell/zenworks/cache/zmd/web/packages/*

rm /var/opt/novell/zenworks/lib/zmd/services
rm /var/opt/novell/zenworks/lib/zmd/subscriptions.xml
rm /var/opt/novell/zenworks/lib/zmd/subscriptions

/etc/init.d/novell-zmd start

#Here is where we can add in our service add functionality to the script. 
#Uncomment the lines below and change the rug sa command to fit your environment.
#Note: the Sleep is needed to ensure that the zmd daemon is fully started.
#sleep 5
#/opt/novell/zenworks/bin/rug sa -k some-regkey https://zlm-server-hostname

Once you have the script ready then you can run it and it will clean out the proper files so that you can move forward in adding your service via rug.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell