Tom
2006-Nov-08 04:45 UTC
[Samba] Trouble doing a remote shutdown of a linux machine through samba
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: ------------ CLIP --------------------------------------------------- [2006/11/07 22:20:05, 0] lib/fault.c:fault_report(36) ==============================================================[2006/11/07 22:20:05, 0] lib/fault.c:fault_report(37) INTERNAL ERROR: Signal 11 in pid 12602 (3.0.21b) Please read the Trouble-Shooting section of the Samba3-HOWTO [2006/11/07 22:20:05, 0] lib/fault.c:fault_report(39) From: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf [2006/11/07 22:20:05, 0] lib/fault.c:fault_report(40) ==============================================================[2006/11/07 22:20:05, 0] lib/util.c:smb_panic2(1554) PANIC: internal error [2006/11/07 22:20:05, 0] lib/util.c:smb_panic2(1562) BACKTRACE: 17 stack frames: #0 /usr/sbin/smbd(smb_panic2+0x8c) [0x801f6bdc] #1 /usr/sbin/smbd(smb_panic+0x1a) [0x801f6e0a] #2 /usr/sbin/smbd [0x801e0d77] #3 /lib/libc.so.6 [0x4023b988] #4 /usr/sbin/smbd [0x800f58ba] #5 /usr/sbin/smbd(api_rpcTNP+0x280) [0x8014c020] #6 /usr/sbin/smbd(api_pipe_request+0xd0) [0x8014c4b0] #7 /usr/sbin/smbd [0x801480dc] #8 /usr/sbin/smbd(write_to_pipe+0xf7) [0x80146907] #9 /usr/sbin/smbd [0x80053696] #10 /usr/sbin/smbd(reply_trans+0xac3) [0x800543f3] #11 /usr/sbin/smbd [0x800a6dc1] #12 /usr/sbin/smbd(process_smb+0x19e) [0x800a71ee] #13 /usr/sbin/smbd(smbd_process+0x159) [0x800a81e9] #14 /usr/sbin/smbd(main+0x949) [0x80284139] #15 /lib/libc.so.6(__libc_start_main+0xc6) [0x40227d06] #16 /usr/sbin/smbd [0x8003b9d1] -------------- END CLIP --------------------------------------------- I'm using Samba 3.0.21b on a Slackware 9.1 install. I've also tried using this command to shutdown/restart a Samba 3.0.23c server running on Slackware 10.1 with the same results. Any suggestions would be greatly appreciated. Does Samba allow for this at all? Regards, Tom
Franz Strebel
2006-Nov-08 09:26 UTC
[Samba] Trouble doing a remote shutdown of a linux machine through samba
I'm not sure if you can do this but I would suggest doing this via ssh. Regards, Franz
Adam Tauno Williams
2006-Nov-08 11:44 UTC
[Samba] Trouble doing a remote shutdown of a linux machine through samba
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.
Tom
2006-Nov-08 22:39 UTC
[Samba] Trouble doing a remote shutdown of a linux machine through samba
I have checked this and it does look correct: ---------- smb.conf ------------- shutdown script = /etc/samba/shutdown.sh %z %t %r %f abort shutdown script = /sbin/shutdown -c --------------------------------- --------- shutdown.sh ----------- #!/bin/bash /sbin/shutdown $3 $4 $2 $1 & --------------------------------- If a more detailed log file would help I can get it for the list; but as of right now, all I get in the log file is the following: [2006/11/08 17:32:57, 0] lib/fault.c:fault_report(41) ==============================================================[2006/11/08 17:32:57, 0] lib/fault.c:fault_report(42) INTERNAL ERROR: Signal 11 in pid 3859 (3.0.23c) Please read the Trouble-Shooting section of the Samba3-HOWTO [2006/11/08 17:32:57, 0] lib/fault.c:fault_report(44) From: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf [2006/11/08 17:32:57, 0] lib/fault.c:fault_report(45) ==============================================================[2006/11/08 17:32:57, 0] lib/util.c:smb_panic(1592) PANIC (pid 3859): internal error [2006/11/08 17:32:57, 0] lib/util.c:log_stack_trace(1699) BACKTRACE: 17 stack frames: #0 /usr/sbin/smbd(log_stack_trace+0x2e) [0x802166ce] #1 /usr/sbin/smbd(smb_panic+0x57) [0x802167e7] #2 /usr/sbin/smbd [0x80201f6f] #3 /lib/libc.so.6 [0x40248db8] #4 /usr/sbin/smbd [0x80103eba] #5 /usr/sbin/smbd(api_rpcTNP+0x280) [0x8015e710] #6 /usr/sbin/smbd(api_pipe_request+0xd0) [0x8015eba0] #7 /usr/sbin/smbd [0x8015a5cc] #8 /usr/sbin/smbd(write_to_pipe+0xf7) [0x80158df7] #9 /usr/sbin/smbd [0x8005c259] #10 /usr/sbin/smbd [0x8005c716] #11 /usr/sbin/smbd(reply_trans+0x673) [0x8005d083] #12 /usr/sbin/smbd [0x800b0b6e] #13 /usr/sbin/smbd(smbd_process+0x7cb) [0x800b213b] #14 /usr/sbin/smbd(main+0x100a) [0x802ad2fa] #15 /lib/libc.so.6(__libc_start_main+0xb9) [0x40235469] #16 /usr/sbin/smbd [0x8003ffe1] ------------------------------------------------------------ Thanks, Tom> ------------------------------------------------------------------------ > > Subject: > Re: [Samba] Trouble doing a remote shutdown of a linux machine through samba > From: > Adam Tauno Williams <awilliam@whitemice.org> > Date: > Wed, 08 Nov 2006 06:42:08 -0500 > To: > samba@lists.samba.org > > To: > samba@lists.samba.org > > Content-Transfer-Encoding: > 7bit > Precedence: > list > References: > <45514F3D.7010706@gmail.com> > In-Reply-To: > <45514F3D.7010706@gmail.com> > Reply-To: > awilliam@whitemice.org > Message-ID: > <1162986128.5381.11.camel@aleph.whitemice.org> > Content-Type: > text/plain > MIME-Version: > 1.0 > Message: > 30 > > > 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. > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > samba mailing list > samba@lists.samba.org > https://lists.samba.org/mailman/listinfo/samba
Gerald (Jerry) Carter
2006-Nov-09 19:18 UTC
[Samba] Trouble doing a remote shutdown of a linux machine through samba
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tom wrote:> Any suggestions would be greatly appreciated. Does Samba allow for this > at all?Yes. Remote shutdown is supported. jerry ====================================================================Samba ------- http://www.samba.org Centeris ----------- http://www.centeris.com "What man is a man who does not make the world better?" --Balian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFU39FIR7qMdg1EfYRArx2AKDrI9fgu1XvGcr0+8ttYPa0ckHKIwCgxrH2 m3gz8D3Lphj6tcYd1NSEd7E=13H/ -----END PGP SIGNATURE-----