Restart lmtp daemon
Hi,
is it possible to restart an individual proccess in Mail Service?
I want to restart lmtp daemon.
Is it in /System/Library/LaunchDaemons?
Another question? I've read launchctl documentation but I dont understand the differences betweeb load -w and load without -w. The same for unload. Can somebody explain me that difference?
Thanks for all.
lmtpd is spawned each time the posftix daemon needs it. There's no ability to stop/start it outside of Postfix since it doesn't really apply - when the master postfix process has a message for lmtpd it fires it up. When that message is done, that process dies.
So at best, even if it could be done, the only thing you'd restart would be processes that are currently being handled by lmtpd. Given the nature of lmtpd that probably doesn't account for a lot.
dont understand the differences betweeb load -w and load without -w. The same for unload. Can somebody explain me that difference?
-w writes the change to the .plist, so that the process will be loaded/unloaded after a reboot.
Without the -w switch the process will be loaded/unloaded now, but will revert to its normal state after a reboot.
Similar Messages
-
Manually restart crs daemon in Cluster RAC 11gR2 (11.2)
In Cluster RAC 11g release2 (11.2) on Linux Platform (Red Hat Enterprise Linux Server release 5.3 ), if crs daemon fall down, is it possible to restart manually (in old version: init.crsd start) ? If yes, how?
Edited by: user6717729 on Jun 24, 2010 12:46 AMok I've opened another thread:
Manual restart CRS Daemon in Cluster RAC 11gR2 -
Restart USB daemon or something?
Every once in a while I get connection errors when my Macbook wakes up. USB connected devices either don't respond, connections errors appear, etc. Most of these times it has something to do with the printer/scanner I have. Funniest thing is, sometimes the printer does work while the scanner doesn't.
Logging out of the account and then back in fixes the problem. Instead, I would like to restart the USB daemon 'or something' to make it re-discover all connected USB devices.
Any ideas?HI Rob,
The problems you are experiencing sound like "kernel panics" ... go here to find out how to problem solve with these procedures:
http://www.thexlab.com/faqs/kernelpanics.html
Carolyn -
Have to keep restarting network daemon
I have my netowrk setup as DHCP as a static IP doesnt seem to want to work at all
This is a fresh install so I'm trying to download packages and it will download 20 or 30 megs and then suddenly quit. I have kill pacman, delete the db.lck file, and run /etc/rc.d/network restart in order for it to continue
I finally got a pacman -Syu to run all the way through and even after that it still continues to give me this problem
I dont believe it is hardware problem because I do not have this problem in Windows.
dmesg | grep eth0 just fills up my screen with lines that say eth0: link is up
Tried different network cable just to be sure, and that's not the issue
Thanks
Last edited by Marklar (2011-10-24 04:37:09)Module Size Used by
snd_hda_codec_hdmi 22092 4
nouveau 698515 1
snd_cmipci 32405 0
ttm 54360 1 nouveau
gameport 8163 1 snd_cmipci
drm_kms_helper 25409 1 nouveau
processor 24256 0
drm 183380 3 nouveau,ttm,drm_kms_helper
snd_opl3_lib 8726 1 snd_cmipci
snd_mpu401_uart 5979 1 snd_cmipci
snd_rawmidi 19519 1 snd_mpu401_uart
snd_seq_device 5268 2 snd_opl3_lib,snd_rawmidi
shpchp 26249 0
sg 25557 0
snd_hda_codec_realtek 294224 1
evdev 9530 0
i2c_algo_bit 5199 1 nouveau
mxm_wmi 1393 1 nouveau
video 11228 1 nouveau
snd_hda_intel 22122 0
snd_hda_codec 77927 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
i2c_i801 8187 0
intel_agp 10904 0
intel_gtt 14423 1 intel_agp
iTCO_wdt 12717 0
pcspkr 1819 0
i2c_core 20133 5 nouveau,drm_kms_helper,drm,i2c_algo_bit,i2c_i801
iTCO_vendor_support 1929 1 iTCO_wdt
wmi 8411 1 mxm_wmi
snd_hwdep 6325 2 snd_opl3_lib,snd_hda_codec
snd_pcm 73856 4 snd_hda_codec_hdmi,snd_cmipci,snd_hda_intel,snd_hda_codec
snd_timer 19416 2 snd_opl3_lib,snd_pcm
snd 57786 12 snd_hda_codec_hdmi,snd_cmipci,snd_opl3_lib,snd_mpu401_uart,snd_rawmidi,snd_seq_device,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore 6146 1 snd
snd_page_alloc 7121 2 snd_hda_intel,snd_pcm
pci_hotplug 25672 1 shpchp
mei 31249 0
button 4470 1 nouveau
r8169 42643 0
mii 3995 1 r8169
ext4 369556 3
mbcache 5817 1 ext4
jbd2 71074 1 ext4
crc16 1297 1 ext4
usbhid 35256 0
hid 81635 1 usbhid
sr_mod 14951 0
cdrom 36329 1 sr_mod
sd_mod 28307 5
pata_acpi 3376 0
xhci_hcd 70396 0
ata_piix 22005 4
libata 173297 2 pata_acpi,ata_piix
scsi_mod 131482 4 sg,sr_mod,sd_mod,libata
ehci_hcd 39511 0
usbcore 142544 4 usbhid,xhci_hcd,ehci_hcd
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation 2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB Controller: Intel Corporation 6 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.4 PCI bridge: Intel Corporation 82801 PCI Bridge (rev b5)
00:1c.5 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 6 (rev b5)
00:1c.6 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 7 (rev b5)
00:1d.0 USB Controller: Intel Corporation 6 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation P67 Express Chipset Family LPC Controller (rev 05)
00:1f.2 IDE interface: Intel Corporation 6 Series Chipset Family 4 port SATA IDE Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series Chipset Family SMBus Controller (rev 05)
00:1f.5 IDE interface: Intel Corporation 6 Series Chipset Family 2 port SATA IDE Controller (rev 05)
01:00.0 VGA compatible controller: nVidia Corporation Device 1201 (rev a1)
01:00.1 Audio device: nVidia Corporation Device 0e0c (rev a1)
03:00.0 PCI bridge: Device 1b21:1080 (rev 01)
04:00.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
05:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)
06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06) -
LMS 4.2 User Defined Groups Empty after Daemon restart
Hello
I need some help here.
In order to get topology services to run on a non resolvable DNS server I have followed the instructions in the online help and got Topology Services to start. My issue now is that all my userdefined groups are empty and I can not edit them - it gives me a error message.
Checked the parent groups and these are as supposed - the system groups - subnet groups fx are also populated.
What do you advise?
I have read oither posts and some people were advised to restart crmdmgtd as in this thread:
net stop crmdmgtd
net start crmdmgtd
http://https://supportforums.cisco.com/message/3414498#3414498
Should I just follow the same steps? I can not see find this process in 4.2
Thanks Isaac
PS: These were the steps followed in order to make Topology Services to work.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The Cisco Prime LMS client must be able to resolve the hostname of the Cisco Prime LMS server to server's IP Address, through DNS.
If the Cisco Prime LMS server is not DNS resolvable, Cisco Prime LMS client can access it with the IP address itself, by performing the following steps:
Open the orb.properties file. Solaris or Soft Appliance: NMSROOT/lib/classpath Windows: NMSROOT\lib\classpath where NMSROOT is the directory where you have installed Cisco Prime LMS. Set the property as follows: jacorb.dns.enable=off Go to Admin > Trust Management > Local Server > Certificate Setup.
The Certificate Setup page appears. Enter the IP Address of the Cisco Prime LMS Server in the Hostname textbox. Populate the other columns as explained in the Online help for Administration of Cisco Prime LAN Management Solution 4.2. Click Apply to generate the self-signed certificate. Restart the daemons. See the Online help for Administration of Cisco Prime LAN Management Solution 4.2 for instructions. You will be able to launch Topology Services with the IP address itself.Hi Michel and thanks for the reply.
The "Physical Location" groups magically started working. I had tried to apply a bunch of device update packages a couple of days ago. I thought they all failed but maybe some of them actually applied. I have no idea but the 2 groups with a rule like this one are now populating:
Device.Hostname startswith "XYZ"
However, the groups with the rule below are still failing to populate in the device selector even though if I edit the group the "Objects matching criteria" list contains the correct members:
Device.Admin_responsibility equals "XYZ"
Admin_responsibility is user defined field 1 (Admin => Device Credential Settings => User Defined Fields).
If you mean "dynamic" in that they are supposed to automatically update then yes these are dynamic public groups. I had them defined this way for years in LMS 2.6, though the "dynamic" part never worked. I always had to go into group admin and manually refresh to get the groups to update. I have tried that several times in 4.1 with no luck.
-Jeff -
Minecraft server script (run minecraft server as a daemon in Arch)
Hey all, I just finished editing and setting up a nice script to run a Minecraft server at boot in Arch. This is based on the original script on the minecraft wiki here. I've edited it to be suitable to place in your /etc/rc.d/ folder with the name "minecraft" (/etc/rc.d/minecraft).
This requires a user "minecraft" with the home directory /home/minecraft to work by default.
I decided I wanted to run the server entirely in RAM so I store all my files in /home/minecraft/backup while the server is offline. When it starts up it makes a tmpfs mount at /home/minecraft/minecraft and copies all the files there and runs from there. It makes an hourly backup using /etc/rc.d/backup stored in /home/minecraft/onlinebackup, first erasing the current backup and creating a new one. This is simply to save space. In the event of a crash without proper stopping of the daemon you will have a backup from your previous reboot (or restart of your minecraft server) in /home/minecraft/backup and one from within the previous hour in /home/minecraft/onlinebackup which I figure ought to be enough. You can manually backup at any time by restarting the daemon.
All paths can be altered. You can run this game under your normal user if you wish, just change the Settings section at the top of the file. RAM amounts may need to be increased for both the server and for the tmpfs, depending on how large your files are (mine are tiny and I have not heard of over 48MB for a game world, but you never know). Just check up on df -h every now and again to make sure your tmpfs has plenty of space, or just increase the allocated maximum size from the start. If you have low RAM you can always change the script to simply not use tmpfs.
If anyone wants, just ask and I can put up a version without tmpfs (should be easy enough to remove yourself but if you're not sure I'll do it for you)
All you need to start off with (if starting your server for the first time, using the scrip as is) is the user minecraft created, with the folders backup, onlinebackup and minecraft in the folder /home/minecraft, your minecraft_server.jar file in /home/minecraft/backup and your oninebackup file in /home/minecraft/backup.
NOTE: onlinebackup file runs from /home/minecraft/minecraft so that if your system crashes, the cron job to run the backups will fail because the link will point to a non-existant file until server is started again.
You can use these commands to with the server: /etc/rc.d/minecraft {start|stop|restart|update|backup}
The backup system is designed to wipe all previous sessions' backups upon starting the server, so do not set it to start the server at boot.
/etc/rc.d/minecraft
#!/bin/bash
# /etc/rc.d/minecraft
. /etc/rc.conf
. /etc/rc.d/functions
#Uncomment line below if using Sun JRE
#. /etc/profile
#Settings
SERVICE='minecraft_server.jar'
USERNAME="minecraft"
MCPATH='/home/minecraft/minecraft'
MCOFFLINEPATH='/home/minecraft/backup'
INVOCATION='java -Xmx768M -Xms768M -jar minecraft_server.jar nogui'
BACKUPPATH='/home/minecraft/onlinebackup'
ME=`whoami`
as_user() {
if [ "$ME" == "$USERNAME" ] ; then
bash -c "$1"
else
su -c - $USERNAME "$1"
fi
mc_start() {
stat_busy "Starting Minecraft Server"
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "Tried to start but $SERVICE was already running!"
else
echo "$SERVICE was not running... starting."
#Move minecraft from backup folder to ram
mount -t tmpfs tmpfs -o size=50m $MCPATH
cp -a $MCOFFLINEPATH/* $MCPATH
echo "Files moved to RAM."
cd $MCPATH
as_user "cd $MCPATH && screen -dmS minecraft $INVOCATION"
sleep 7
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is now running."
#Create hourly backups while running
ln -s $MCPATH/onlinebackup /etc/cron.hourly/minecraftonlinebackup
echo "Hourly backups initiated."
else
echo "Could not start $SERVICE."
umount $MCPATH
fi
fi
add_daemon minecraft
stat_done
mc_saveoff() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running... suspending saves."
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP STARTING. Server going readonly...\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-off\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
sync
sleep 10
else
echo "$SERVICE was not running. Not suspending saves."
fi
mc_saveon() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running... re-enabling saves."
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-on\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP ENDED. Server going read-write...\"\015'"
else
echo "$SERVICE was not running. Not resuming saves."
fi
mc_stop() {
stat_busy "Stopping Minecraft Server"
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running... stopping."
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER SHUTTING DOWN IN 10 SECONDS. Saving map...\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
sleep 10
as_user "screen -p 0 -S minecraft -X eval 'stuff \"stop\"\015'"
sleep 7
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE could not be shut down... still running."
else
echo "$SERVICE is shut down."
#Stop hourly backups
rm /etc/cron.hourly/minecraftonlinebackup
echo "Hourly backup halted."
#Unmount tmpfs
cp -a $MCPATH/* $MCOFFLINEPATH
umount $MCPATH
echo "Files copied to HDD."
fi
else
echo "$SERVICE was not running."
fi
rm_daemon minecraft
stat_done
mc_update() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running! Will not start update."
else
MC_SERVER_URL=http://minecraft.net/`wget -q -O - http://www.minecraft.net/download.jsp | grep minecraft_server.jar\</a\> | cut -d \" -f 2`
as_user "cd $MCPATH && wget -q -O $MCPATH/minecraft_server.jar.update $MC_SERVER_URL"
if [ -f $MCPATH/minecraft_server.jar.update ]
then
if `diff $MCPATH/minecraft_server.jar $MCPATH/minecraft_server.jar.update >/dev/null`
then
echo "You are already running the latest version of $SERVICE."
else
as_user "mv $MCPATH/minecraft_server.jar.update $MCPATH/minecraft_server.jar"
echo "Minecraft successfully updated."
fi
else
echo "Minecraft update could not be downloaded."
fi
fi
mc_backup() {
echo "Backing up minecraft world"
if [ -d $BACKUPPATH/world_`date "+%m.%d.%Y"` ]
then
for i in 1 2 3 4 5 6
do
if [ -d $BACKUPPATH/world_`date "+%m.%d.%Y"`-$i ]
then
continue
else
as_user "cd $MCPATH && cp -r world $BACKUPPATH/world_`date "+%m.%d.%Y"`-$i"
break
fi
done
else
as_user "cd $MCPATH && cp -r world $BACKUPPATH/world_`date "+%m.%d.%Y"`"
echo "Backed up world"
fi
echo "Backing up the minecraft server executable"
if [ -f "$BACKUPPATH/minecraft_server_`date "+%m.%d.%Y"`.jar" ]
then
for i in 1 2 3 4 5 6
do
if [ -f "$BACKUPPATH/minecraft_server_`date "+%m.%d.%Y"`-$i.jar" ]
then
continue
else
as_user "cd $MCPATH && cp minecraft_server.jar \"$BACKUPPATH/minecraft_server_`date "+%m.%d.%Y"`-$i.jar\""
break
fi
done
else
as_user "cd $MCPATH && cp minecraft_server.jar \"$BACKUPPATH/minecraft_server_`date "+%m.%d.%Y"`.jar\""
fi
echo "Backup complete"
#Start-Stop here
case "$1" in
start)
mc_start
stop)
mc_stop
restart)
mc_stop
mc_start
update)
mc_stop
mc_backup
mc_update
mc_start
backup)
mc_saveoff
mc_backup
mc_saveon
status)
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running."
else
echo "$SERVICE is not running."
fi
echo "Usage: /etc/rc.d/minecraft {start|stop|update|backup|status|restart}"
exit 1
esac
exit 0
/home/minecraft/backup/onlinebackup
#!/bin/bash
# /home/minecraft/backup/onlinebackup
rm -rf /home/minecraft/onlinebackup/*
/etc/rc.d/minecraft backup
UPDATE:
rationalOgre has created an alternate script with a different backup system, which will keep compressed copies of your world indefinitely, along with a working update function. https://bbs.archlinux.org/viewtopic.php … 97#p944797
Last edited by PIMPinator (2011-06-08 14:00:54)@PIMPinator - Weird. On mine, if I don't source /etc/profile it won't work. No clue what the difference is. I tested it after I got it up and running, removing different elements to see if one or the other was the problem. Without it all in place it just didn't work.
I made some modifications to your script today. Fixed "update" so it works properly. (You had it running mc_backup after mc_stop, which never worked on my system.) I basically reworked it so it runs the backup, then stops the server and performs the update in the ~/backup directory, then restarts the server. I also completely overhauled the "backup" system. (for this to work you have to comment out the rm -rf ~/onlinebackup/* directive in the onlinebackup script.) Now, it creates 4 rolling backups of the server, in tar.gz format. What this means is that over time, you will accumulate the last 4 backups for each day in your ~/onlinebackup folder. I thought about creating a cleanup function to cull anything over 2 days old but to be honest, even if your world was > 50MB, zipped up it's going to be about ~20mb which means you can have 50 of them and only be taking up a gig of server space. Anyway, here's the code if you are interested.
#!/bin/bash
# /etc/init.d/minecraft
. /etc/rc.conf
. /etc/rc.d/functions
#Comment out the following if using OpenJDK
. /etc/profile
#Settings
SERVICE='minecraft_server.jar'
USERNAME="minecraft"
MCPATH='/home/minecraft/minecraft'
MCOFFLINEPATH='/home/minecraft/backup'
INVOCATION='java -Xmx768M -Xms768M -jar minecraft_server.jar nogui'
BACKUPPATH='/home/minecraft/onlinebackup'
ME=`whoami`
as_user() {
if [ "$ME" == "$USERNAME" ] ; then
bash -c "$1"
else
su -c - $USERNAME "$1"
fi
mc_start() {
stat_busy "Starting Minecraft Server"
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "Tried to start but $SERVICE was already running!"
else
echo "$SERVICE was not running... starting."
#Move minecraft from backup folder to ram
mount -t tmpfs tmpfs -o size=50m $MCPATH
cp -a $MCOFFLINEPATH/* $MCPATH
echo "Files moved to RAM."
cd $MCPATH
as_user "cd $MCPATH && screen -dmS minecraft $INVOCATION"
sleep 7
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is now running."
#Create hourly backups while running
ln -s $MCPATH/onlinebackup /etc/cron.hourly/minecraftonlinebackup
echo "Hourly backups initiated."
else
echo "Could not start $SERVICE."
umount $MCPATH
fi
fi
add_daemon minecraft
stat_done
mc_saveoff() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running... suspending saves."
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP STARTING. Server going readonly...\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-off\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
sync
sleep 10
else
echo "$SERVICE was not running. Not suspending saves."
fi
mc_saveon() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running... re-enabling saves."
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-on\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP ENDED. Server going read-write...\"\015'"
else
echo "$SERVICE was not running. Not resuming saves."
fi
mc_stop() {
stat_busy "Stopping Minecraft Server"
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running... stopping."
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER SHUTTING DOWN IN 10 SECONDS. Saving map...\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
sleep 10
as_user "screen -p 0 -S minecraft -X eval 'stuff \"stop\"\015'"
sleep 7
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE could not be shut down... still running."
else
echo "$SERVICE is shut down."
#Stop hourly backups
rm /etc/cron.hourly/minecraftonlinebackup
echo "Hourly backup halted."
#Unmount tmpfs
cp -a $MCPATH/* $MCOFFLINEPATH
umount $MCPATH
echo "Files copied to HDD."
fi
else
echo "$SERVICE was not running."
fi
rm_daemon minecraft
stat_done
mc_update() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running! Will not start update."
else
MC_SERVER_URL=http://minecraft.net/`wget -q -O - http://www.minecraft.net/download.jsp | grep minecraft_server.jar\</a\> | cut -d \" -f 2`
as_user "cd $MCOFFLINEPATH && wget -q -O $MCOFFLINEPATH/minecraft_server.jar.update $MC_SERVER_URL"
if [ -f $MCOFFLINEPATH/minecraft_server.jar.update ]
then
if `diff $MCOFFLINEPATH/minecraft_server.jar $MCOFFLINEPATH/minecraft_server.jar.update >/dev/null`
then
echo "You are already running the latest version of $SERVICE."
rm $MCOFFLINEPATH/minecraft_server.jar.update
else
as_user "mv $MCOFFLINEPATH/minecraft_server.jar.update $MCOFFLINEPATH/minecraft_server.jar"
echo "Minecraft successfully updated."
fi
else
echo "Minecraft update could not be downloaded."
fi
fi
mc_backup() {
echo "Backing up minecraft world"
local COUNTER=
if [ -f $BACKUPPATH/co ]
then
COUNTER=`cat $BACKUPPATH/co`
if [ $COUNTER -gt 4 ]
then
#Loop back to 1 if greater than the max number of desired saves (4 hardcoded)
as_user "echo 1 > $BACKUPPATH/co"
COUNTER=1
fi
else
COUNTER=1
as_user "echo 1 > $BACKUPPATH/co"
fi
if [ -f $BACKUPPATH/world_`date "+%m.%d.%Y"`-$COUNTER.tar.gz ]
then
as_user "rm $BACKUPPATH/world_`date "+%m.%d.%Y"`-$COUNTER.tar.gz"
fi
as_user "cd $MCPATH && tar -czf $BACKUPPATH/world_`date "+%m.%d.%Y"`-$COUNTER.tar.gz world"
#now to update the counter
as_user "echo $(($COUNTER + 1)) > $BACKUPPATH/co"
echo "Backup complete..."
#Start-Stop here
case "$1" in
start)
mc_start
stop)
mc_stop
restart)
mc_stop
mc_start
update)
mc_saveoff
mc_backup
mc_saveon
mc_stop
mc_update
mc_start
backup)
mc_saveoff
mc_backup
mc_saveon
status)
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running."
else
echo "$SERVICE is not running."
fi
echo "Usage: /etc/rc.d/minecraft {start|stop|update|backup|status|restart}"
exit 1
esac
exit 0
I hope you don't mind.
EDIT: Made a small change later that I came back and put in. If you are currently at the latest release it removes the .update file it created.
Last edited by rationalOgre (2011-06-07 23:05:58) -
IAS console doesn't work due DCM daemon failure
Hi,
I've got a problem with IAS console recently.
When I try to open Application or Administration tabs for my OC4J Instance I get an error message:
<ias-component id="dcm-daemon">
<process-type id="dcm-daemon">
<process-set id="dcm">
<process id="650183386" pid="7996" status="Init" index="1" log="D:\oracleIASUAT\opmn\logs\dcm-daemon~dcm-daemon~dcm~1" operation="request" result="failure">
<msg code="-21" text="failed to start a managed process after the maximum retry limit">
</msg>
</process>
</process-set>
</process-type>
</ias-component>
opmnctl status shows that dcm-daemon process is down.
When I try start process
opmnctl startproc process-type=dcm-daemon
got error:
no enabled components for this request
emctl start iasconsole doesn't help
What is the problem and where look for solution?
Thanks in advance.
Edited by: Sah on Oct 15, 2009 6:02 PMContent of D:\oracleIASUAT\dcm\logs\emd_logs\log.xml
<MESSAGE>
<HEADER>
<TSTZ_ORIGINATING>2009-10-15T18:05:07.844+04:00</TSTZ_ORIGINATING>
<COMPONENT_ID>DCM</COMPONENT_ID>
<MSG_TYPE TYPE="ERROR"></MSG_TYPE>
<MSG_LEVEL>1</MSG_LEVEL>
<HOST_ID>host1</HOST_ID>
<HOST_NWADDR>10.10.10.10</HOST_NWADDR>
<MODULE_ID>oracle/defaultLogger/ExceptionLogger</MODULE_ID>
<THREAD_ID>EMUI_18_05_04_/console/ias/applicationServer$type=oracle*ias$target=uat.host1</THREADID>
<USER_ID>SYSTEM</USER_ID>
</HEADER>
<CORRELATION_DATA>
<EXEC_CONTEXT_ID><UNIQUE_ID>10.10.10.10:99043:1255614349859:3</UNIQUE_ID><SEQ>0</SEQ></EXEC_CONTEXT_ID>
</CORRELATION_DATA>
<PAYLOAD>
<MSG_TEXT>[TM] TaskMaster sysInit failed for D:\oracleIASUAT</MSG_TEXT>
<SUPPL_DETAIL><![CDATA[oracle.ias.sysmgmt.exception.ProcessMgmtException: Base Exception:
OPMN Request: /start?mode=sync&ias-component=dcm-daemon
OPMN Response: HTTP/1.1 204 No Content
Content-Length: 710
Content-Type: text/html
Response: 0 of 1 processes started.
<?xml version='1.0' encoding='US-ASCII'?>
<response>
<opmn id="host1:6201" http-status="204" http-response="0 of 1 processes started.">
<ias-instance id="uat.host1">
<ias-component id="dcm-daemon">
<process-type id="dcm-daemon">
<process-set id="dcm">
<process id="650183387" pid="6200" status="Init" index="1" log="D:\oracleIASUAT\opmn\logs\dcm-daemon~dcm-daemon~dcm~1" operation="request" result="failure">
<msg code="-21" text="failed to start a managed process after the maximum retry limit">
</msg>
</process>
</process-set>
</process-type>
</ias-component>
</ias-instance>
</opmn>
</response>
Resolution:
If there is no response from OPMN, check OPMN configuration and restart DCM daemon. If OPMN response is available, identify the failure and the corresponding log files indicated in the OPMN response contents
at oracle.ias.sysmgmt.clustermanagement.OpmnAgent.checkOpmnResponse(Unknown Source)
at oracle.ias.sysmgmt.clustermanagement.OpmnAgent.validateOperation(Unknown Source)
at oracle.ias.sysmgmt.clustermanagement.OpmnAgent.sendRequest(Unknown Source)
at oracle.ias.sysmgmt.task.ProcessManager.start(Unknown Source)
at oracle.ias.sysmgmt.task.TaskMaster.daemonStart(Unknown Source)
at oracle.ias.sysmgmt.task.TaskMaster.sysInit(Unknown Source)
at oracle.ias.sysmgmt.task.TaskMaster.sysInit(Unknown Source)
at oracle.ias.sysmgmt.task.InstanceManager.sysInit(Unknown Source)
at oracle.ias.sysmgmt.task.InstanceManager.init(Unknown Source)
at oracle.ias.sysmgmt.EntryPoint.init(Unknown Source)
at oracle.sysman.emSDK.eml.util.iAS.IASEntryPoint.initEntrypoint(IASEntryPoint.java:145)
at oracle.sysman.emSDK.eml.util.iAS.IASEntryPoint.getEntryPoint(IASEntryPoint.java:266)
at oracle.sysman.ias.sta.clusters.ClusterUtils.getClusterManager(ClusterUtils.java:385)
at oracle.sysman.ias.sta.ias.applicationServer.getOverview(applicationServer.java:1059)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at oracle.cabo.ui.data.provider.MethodDataProvider.getDataObject(Unknown Source)
at oracle.cabo.ui.data.provider.TableDataProvider.getDataObject(Unknown Source)
at oracle.cabo.ui.data.provider.CachingDataProvider.getDataObject(Unknown Source)
at oracle.cabo.ui.data.provider.DataProviderStack.getDataObject(Unknown Source)
at oracle.cabo.ui.LogicalNodeRenderingContext.getDataObject(Unknown Source)
at oracle.cabo.ui.RootRenderingContext.getDataObject(Unknown Source)
at oracle.cabo.ui.LogicalNodeRenderingContext.getDataObject(Unknown Source)
at oracle.cabo.ui.RootRenderingContext.getDataObject(Unknown Source)
at oracle.cabo.ui.data.DataBoundValue.getValue(Unknown Source)
at oracle.cabo.ui.data.bind.ToBooleanBoundValue.getValue(Unknown Source)
at oracle.cabo.ui.BaseUINode.getAttributeValueImpl(Unknown Source)
at oracle.cabo.ui.BaseUINode.getAttributeValue(Unknown Source)
at oracle.cabo.ui.BaseRenderer.skipNode(Unknown Source)
at oracle.cabo.ui.BaseRenderer.skipChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.getNextRenderedChildIndex(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLafRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.composite.ContextPoppingUINode$ContextPoppingRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLafRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLafRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.BorderLayoutRenderer.renderIndexedChildren(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.BorderLayoutRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLafRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLafRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.composite.UINodeRenderer.renderWithNode(Unknown Source)
at oracle.cabo.ui.composite.UINodeRenderer.render(Unknown Source)
at oracle.cabo.ui.laf.oracle.desktop.PageLayoutRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLafRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.BodyRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderNamedChild(Unknown Source)
at oracle.cabo.ui.laf.base.SwitcherRenderer._renderCase(Unknown Source)
at oracle.cabo.ui.laf.base.SwitcherRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.laf.base.DataScopeRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.BodyRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.DocumentRenderer.renderContent(Unknown Source)
at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.DocumentRenderer.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.ui.BaseUINode.render(Unknown Source)
at oracle.cabo.servlet.ui.UINodePageRenderer.renderPage(Unknown Source)
at oracle.cabo.servlet.AbstractPageBroker.renderPage(Unknown Source)
at oracle.cabo.servlet.PageBrokerHandler.handleRequest(Unknown Source)
at oracle.cabo.servlet.UIXServlet.doGet(Unknown Source)
at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:347)
at oracle.sysman.eml.app.Console.doGet(Console.java:271)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:837)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)
]]></SUPPL_DETAIL>
</PAYLOAD>
</MESSAGE> -
Lms 3.2 and window server 2008 standard: License Server/Daemon Manager is down
LMS 3.2 and window server 2008 standard, get error when we try
Khi truy nhập vào menu chức năng:
License Server/Daemon Manager is down. Please check license.log for more information.
access licensing:
Error communicating with License Server. License Server may be down. Please start the License Server, then refresh the page.
Lincense.txt is file log of LMS
Must I have to active window server 2008 first ?
thank you very much ?Hi ,
--Add the Casuser to the Administrator Group
and then reset the casuser password:
1. Go to CSCOpx\setup\support> and run the following command:
resetCasuser.exe
2. Restart the daemon manager:
Net stop crmdmgtd
Net start crmdmgtd
Let me know how it works
If above did not help then send me the syslog.log and screen shot of the EventViewer with the latest Application Error that you see there.
--also screen shot of the below directory :
NMSROOT\etc\license
Thanks
Afroj -
How to start a independant Daemon program from another java daemon?
Hello,
I made two java daemon program Daemon_A and Daemon_B. By definition these two program work whithout any user interaction but most of it they should never fall down.
So in order to be sure that the both daemon are up (and to prevent any failure) I create a mechanism to check each other and if one is down it will be restart by the other one.
Up to now I succeed to restart the one who fall down. But ... there is always a but ...
At start:
- 1) Daemon_A and Daemon_B start.
- 2) Daemon_B fall down.
- 3) Daemon_A restart Daemon_B using this:
String[] commandArray = new String[3];
commandArray[0] = "../bin/java";
commandArray[1] = "-jar";
commandArray[2] = "Daemon_B.jar";
Process oProcess = runtime.exec ( commandArray, (String[]) null);- 4) Daemon_A and Daemon_B are UP again.
- 5) Daemon_A crash then Daemon_B is kill too.
So once the Daemon_B is restarted it seems that there is still a link between Daemon_A and Daemon_B.
As I use a command system to restart the daemon I don't understand why my Daemon_B is dependant from the Daemon_A.
Is there another way of doing this?
How can I restart my Daemon_B (from the Daemon_A) in a independant process?
As i'm running out of idea any help will be apreciate,
thanks
EmmanuelBecause you do not need javaw on Unix. You can achieve
what you want in the normal Unix way. Confer: nohup,
&, stderr and stdout redircetion.That's not correct, I can not achieve what I want on Unix.
Well with the above piece of code if I use javaw for launching my command through a system command (runtime.exec) on windows it will start a 100% independant process which is find.
But under unix if I keep using simply java the process will stay a child process. Which mean if the "father daemon_A" die daemon_B will die too.
So that's why I woudering if there is a similar program as javaw on unix to avoid create chid process using 'runtime.exec'.
You mentioned crontab: it does not make an item to act
as a deamon, it rather periodically runs it. Yhea you right my mistake I don't use the crontab to launch the program. I use "etc/init.d" (for sun solaris) and service for windows. Otherwise the daemons are "real" daemon: one's they are started they keep listening and should never fall. But to get a hight level of security I want to be sure if one fall it will be restarted whithout beeing a child process of the other one.
so any idea on unix of how can I re-start a daemon in a independant way?
regards,
emmanuel -
Error in Loading Daemon plist programmatically
I'm trying to a Load LaunchDaemon plist from my Mac Application.When i try to load it in terminal it loads successfully, but when i try to load it thru my code, it doesn't work.
Here is my code :
OSStatus status;
AuthorizationRef authorizationRef;
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorizationRef);
if (status != errAuthorizationSuccess)
NSString *err = [NSString stringWithFormat:@"Error Creating Initial Authorization : %d", status];
[self ShowErrorAndExit:err];
// kAuthorizationRightExecute == "system.privilege.admin"
AuthorizationItem right = {kAuthorizationRightExecute, 0, NULL, 0};
AuthorizationRights rights = {1, &right};
AuthorizationFlags flags = kAuthorizationFlagDefaults |
kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagPreAuthorize |
kAuthorizationFlagExtendRights;
// Call AuthorizationCopyRights to determine or extend the allowable rights.
status = AuthorizationCopyRights(authorizationRef, &rights, NULL, flags, NULL);
if (status != errAuthorizationSuccess)
NSString *err = [NSString stringWithFormat:@"Sorry, we need Administrator priviliges to Continue"];
[self ShowErrorAndExit:err];
// After getting the Authorization Reference, executing the launchctl to load my LaunchDaemon
char *daemonplist="/Library/LaunchDaemons/com.myappdaemon.plist";
char *launchctl="/bin/launchctl";
char *launchdArgs[]={"load",daemonplist,NULL};
FILE *ldpipe=NULL;
OSStatus;
status=AuthorizationExecuteWithPrivileges(authorizationRef,launchctl,kAuthorizationFlagDefaults,launchdArgs,&ldpipe);
if(status!=errAuthorizationSuccess)
NSLog(@"Error:%d",status);
if(status==errAuthorizationSuccess)
NSLog(@" succesfully loaded the daemon plist);
status=AuthorizationFree(authorizationRef,kAuthorizationFlagDestroyRights);
My plist :
<key> Label</key>
<string>com.myappdaemon</string>
<key>Program</key>
<string>/Applications/myapplication.app/Contents/MacOS/myappdaemon</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/myapplication.app/Content/MacOs/myappdaemon</string>
</array>
<key>WorkingDirectory</key>
<string>/Library/myapplication</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>RunAtLoad</key>
</true>
<key>keepAlive</key>
<true/>
Thing is it shows the daemon plist is loaded successfully, but it's not. And After system restart the daemon starts fine. The plist loads fine in terminal. I have even tried with '-w' & '-F' to force load the daemon, but it doesn't loads at all. The weird thing is it just keeps saying that the daemon is loaded.
Now what am i doing wrong here ..?Also, now that I look a little closer, the way you've set up the Program and ProgramArguments keys looks funky. If you're using a full path specification without arguments you only need the Program key. If you want to use both, it seems to me the first line in the ProgramArguments key should just be the name of the executable:
<key>Program</key>
<string>/Applications/myapplication.app/Contents/MacOS/myappdaemon</string>
<key>ProgramArguments</key>
<array>
<string>myappdaemon</string>
</array>
As the launchd.plist man page says (unhelpfully) the Program key maps to the first argument of execvp and the first line of the ProgramArguments key maps to the second argument of execvp. My dim understanding of this (based on an explanation someone else gave me) is that execvp's second argument is meant as a kind of display name. if you give one or the other the system will interpret it as a path, but specifying both as full paths is probably not what the system expects. -
I'm trying to a Load LaunchDaemon plist from my Mac Application.When i try to load it in terminal it loads successfully, but when i try to load it thru my code, it doesn't work.
Here is my code :
OSStatus status;
AuthorizationRef authorizationRef;
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorizationRef);
if (status != errAuthorizationSuccess)
NSString *err = [NSString stringWithFormat:@"Error Creating Initial Authorization : %d", status];
[self ShowErrorAndExit:err];
// kAuthorizationRightExecute == "system.privilege.admin"
AuthorizationItem right = {kAuthorizationRightExecute, 0, NULL, 0};
AuthorizationRights rights = {1, &right};
AuthorizationFlags flags = kAuthorizationFlagDefaults |
kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagPreAuthorize |
kAuthorizationFlagExtendRights;
// Call AuthorizationCopyRights to determine or extend the allowable rights.
status = AuthorizationCopyRights(authorizationRef, &rights, NULL, flags, NULL);
if (status != errAuthorizationSuccess)
NSString *err = [NSString stringWithFormat:@"Sorry, we need Administrator priviliges to Continue"];
[self ShowErrorAndExit:err];
// After getting the Authorization Reference, executing the launchctl to load my LaunchDaemon
char *daemonplist="/Library/LaunchDaemons/com.myappdaemon.plist";
char *launchctl="/bin/launchctl";
char *launchdArgs[]={"load",daemonplist,NULL};
FILE *ldpipe=NULL;
OSStatus;
status=AuthorizationExecuteWithPrivileges(authorizationRef,launchctl,kAuthorizationFlagDefaults,launchdArgs,&ldpipe);
if(status!=errAuthorizationSuccess)
NSLog(@"Error:%d",status);
if(status==errAuthorizationSuccess)
NSLog(@" succesfully loaded the daemon plist);
status=AuthorizationFree(authorizationRef,kAuthorizationFlagDestroyRights);
My plist :
<key> Label</key>
<string>com.myappdaemon</string>
<key>Program</key>
<string>/Applications/myapplication.app/Contents/MacOS/myappdaemon</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/myapplication.app/Content/MacOs/myappdaemon</string>
</array>
<key>WorkingDirectory</key>
<string>/Library/myapplication</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>RunAtLoad</key>
</true>
<key>keepAlive</key>
<true/>
Thing is it shows the daemon plist is loaded successfully, but it's not. And After system restart the daemon starts fine. The plist loads fine in terminal. I have even tried with '-w' & '-F' to force load the daemon, but it doesn't loads at all. The weird thing is it just keeps saying that the daemon is loaded.
Now what am i doing wrong here ..?I'm trying to a Load LaunchDaemon plist from my Mac Application.When i try to load it in terminal it loads successfully, but when i try to load it thru my code, it doesn't work.
Here is my code :
OSStatus status;
AuthorizationRef authorizationRef;
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorizationRef);
if (status != errAuthorizationSuccess)
NSString *err = [NSString stringWithFormat:@"Error Creating Initial Authorization : %d", status];
[self ShowErrorAndExit:err];
// kAuthorizationRightExecute == "system.privilege.admin"
AuthorizationItem right = {kAuthorizationRightExecute, 0, NULL, 0};
AuthorizationRights rights = {1, &right};
AuthorizationFlags flags = kAuthorizationFlagDefaults |
kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagPreAuthorize |
kAuthorizationFlagExtendRights;
// Call AuthorizationCopyRights to determine or extend the allowable rights.
status = AuthorizationCopyRights(authorizationRef, &rights, NULL, flags, NULL);
if (status != errAuthorizationSuccess)
NSString *err = [NSString stringWithFormat:@"Sorry, we need Administrator priviliges to Continue"];
[self ShowErrorAndExit:err];
// After getting the Authorization Reference, executing the launchctl to load my LaunchDaemon
char *daemonplist="/Library/LaunchDaemons/com.myappdaemon.plist";
char *launchctl="/bin/launchctl";
char *launchdArgs[]={"load",daemonplist,NULL};
FILE *ldpipe=NULL;
OSStatus;
status=AuthorizationExecuteWithPrivileges(authorizationRef,launchctl,kAuth orizationFlagDefaults,launchdArgs,&ldpipe);
if(status!=errAuthorizationSuccess)
NSLog(@"Error:%d",status);
if(status==errAuthorizationSuccess)
NSLog(@" succesfully loaded the daemon plist);
status=AuthorizationFree(authorizationRef,kAuthorizationFlagDestroyRights) ;
My plist :
<key> Label</key>
<string>com.myappdaemon</string>
<key>Program</key>
<string>/Applications/myapplication.app/Contents/MacOS/myappdaemon</string >
<key>ProgramArguments</key>
<array>
<string>/Applications/myapplication.app/Content/MacOs/myappdaemon</string>
</array>
<key>WorkingDirectory</key>
<string>/Library/myapplication</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>RunAtLoad</key>
</true>
<key>keepAlive</key>
<true/>
Thing is it shows the daemon plist is loaded successfully, but it's not. And After system restart the daemon starts fine. The plist loads fine in terminal. I have even tried with '-w' & '-F' to force load the daemon, but it doesn't loads at all. The weird thing is it just keeps saying that the daemon is loaded.
Now what am i doing wrong here ..? -
Ciscoworks daemon manager stuck at Stopping state
I am working on LMS 3.2 . Tried to stop the daemon service with " net stop crmdmgtd ". It stuck on stopping state since few hours now. I can still open the application. Need a suggestion to terminate the previous command and restart the
daemon service.You should have dmgtd.exe process in Task Manager stuck.
Although you can kill it directly and then try the stop command once again before starting. But to be sure if any process in not stuck, best way would be to reboot the server once. -
CWMLS daemon manager service could not be started
Hello,
Our server in which we have installed Ciscoworks LMS was restarted due to power supply problems. After that "CiscoWorks Daemon Manager" service is not getting started. I've tried to stop all the ciscoworks related services and restart it, also tried restarting the server machine. Ciscoworks LMS Version 3.0, installed on windows 2000 SP4. The error message is:
E:>net start crmdmgtd
The CiscoWorks Daemon Manager service is starting.
The CiscoWorks Daemon Manager service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.
I've changed casuser password using resetCasuser.exe file, but there was no change.
Any clue?Hi ,
Please attach the syslog.log ( If it is huge in size then truncate and send me some of the Lateste logs..)
--Screen shot of the services.msc winodw ( with all the cisco works service)
--Go to start >control Panel >Administrative Tools > Event Viewer > open the Application logs and send me the screen shot of the lastest event ..
In the mean time try this :
go to services.msc > change the startup type of the Daemon Manager to MAUNAL from Automatic and
ReBoot the Server ... Once server is back online > change the startup type back to Automatic and Try to Restart the Daemon Manager .
Note : Please make sure the IIS Admin service is Disable
Thanks
Afroj -
whenever I restart a daemon (squeezebox-server) I receive the same error
Your locale was detected as C, you may have problems with non-Latin filenames. Consider changing your LANG variable to the correct locale, i.e. en_US.utf8
my locale is set as en_US.utf8 in rc.conf. Why do I still get this message?thanks karol. I didn't had DAEMON_LOCALE set to anything. but after doing so I received the same message
[j@janus ~]$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
[j@janus ~]$ locale -a
C
en_US
en_US.iso88591
en_US.utf8
POSIX
The problem is reported in a Perl written server (Squeezebox-Server) .
Last edited by theking2 (2011-07-17 18:49:13) -
How do I restart the SNMP agents with the original command line options?
I'm creating an application that changes the SNMP trap target configuration files and then restarts the SNMP agent. I'm currently working with the mibiisa agent. I want to make sure that I restart the service with the new trap targets but with the original command line options. How can I restart the mibiisa service with the same command line options that it originally loaded with?
It is not "Network Time" that is the problem, but actually "SystemStarter." SystemStarter is an interim kludge to enable the work or the old StartupItems until they can be converted to LaunchDaemons or LaunchAgents controlled by launchd. Launcd calls SystemStarter to launch all the unconverted StartupItems. ntpd is now under the control of launchd directly.
Launchctl is the command to load and unload the plist files, but I don't think it has a mechanism to restart a daemon.
There are start and stop commands in launchctl, but the man page indicates that they are for debugging purposes.
I also imagine you could just kill the ntp daemon and let it restart with new settings. It is most likely set to "keepAlive" so that it will automatically restart.
Maybe you are looking for
-
Thumbnails in Bridge lost in files saved with AE CS6
On Windows I have some templates (aet) from AE 7 and CS3 that include thumbnails in the XMP, and Bridge CS6 shows these. If I open these templates in AE CS6 and save them out, no thumbnail is preserved/added to the XMP. I looked through the preferen
-
EDI: Receiver port in control record is invalid
Yesterday, we got refreshed out quality system with the production SAP system. I am trying to process IDoc # QXXXXXXX in quality but I am getting the following error message: EDI: Receiver port in control record is invalid. To create this IDoc, I co
-
How to create template MS documents in portal
Hi Techies, I want to provide my users with a menu option where they can create MS word documents from a template. In a certain folder they need to create documents from a word template, I would fille out some properties in this template by default.
-
View wdDoInit being loaded multiple times
Hello all, I'm building an WD application that has multiple views embeded in Portal. At the lowest level, i got in the detailed navigation multiple IViews, mapped to the corresponding View in WD. In a specific case, i got a list of views on the detai
-
HT3702 I got an automatic renewal on a magazine I no longer want. How do I stop it
I got an iTunes notice that a men's health subscription automatically renewed and my account was charged the renewal fee. How do I cancel this subscription and receive a refund.