[Samba] Trouble doing a remote shutdown of a linux machine through samba

Adam Tauno Williams awilliam at whitemice.org
Wed Nov 8 11:42:08 GMT 2006


On Tue, 2006-11-07 at 22:30 -0500, Tom wrote:
> Is it possible to shutdown a Linux computer through Samba using the 
> shutdown command in Windows XP and 2003? I've tried:
> shutdown /r /m hostname
> This doesn't work and results in Windows reporting "The remote procedure 
> call failed.' in the command window. The Samba log shows the following:

Have you set the "shutdown script" and "abort shutdown script"
directives in your Samba configuration?

abort shutdown script = /sbin/shutdown -c
shutdown script = shutdown script = /etc/samba/shutdown.sh %z %t %r %f

cat /etc/samba/shutdown.sh
---<clip>----
#!/bin/bash
# %z - Message = $1
# %t - Seconds before shutdown starts = $2
# %r - Reboot switch (-r) = $3
# %f - Force switch (-f) = $4

$time=$2
let "time=time/60"
let "time++"
/sbin/shutdown $3 $4 +$time $1 &
---</clip>----

This is all in the smb.conf manual page.



More information about the samba mailing list