This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[samba.git] / docs / docbook / smbdotconf / logon / shutdownscript.xml
1 <samba:parameter name="shutdown script"
2                  context="G"
3                  advanced="1" developer="1"
4                  xmlns:samba="http://samba.org/common">
5 <listitem>
6         <para>
7         This a full path name to a script called by <citerefentry><refentrytitle>smbd</refentrytitle>                                                    
8         <manvolnum>8</manvolnum></citerefentry> that should start a shutdown procedure.</para>
9
10         <para>This command will be run as the user connected to the server.</para>
11
12         <para>%m %t %r %f parameters are expanded:</para>
13         
14         <itemizedlist>
15                 <listitem>
16                         <para><parameter moreinfo="none">%m</parameter> will be substituted with the
17                         shutdown message sent to the server.</para>
18                 </listitem>
19                 
20                 <listitem>
21                         <para><parameter moreinfo="none">%t</parameter> will be substituted with the
22                         number of seconds to wait before effectively starting the
23                         shutdown procedure.</para>
24                 </listitem>
25                 
26                 <listitem>
27                         <para><parameter moreinfo="none">%r</parameter> will be substituted with the
28                         switch <emphasis>-r</emphasis>. It means reboot after shutdown
29                         for NT.</para>
30                 </listitem>
31                 
32                 <listitem>
33                         <para><parameter moreinfo="none">%f</parameter> will be substituted with the
34                         switch <emphasis>-f</emphasis>. It means force the shutdown
35                         even if applications do not respond for NT.</para>
36                 </listitem>
37         </itemizedlist>
38
39         <para>Default: <emphasis>None</emphasis>.</para>
40
41         <para>Example: <command moreinfo="none">shutdown script = /usr/local/samba/sbin/shutdown %m %t %r %f</command></para>
42
43         <para>Shutdown script example:
44 <programlisting format="linespecific">
45 #!/bin/bash
46                 
47 $time=0
48 let &quot;time/60&quot;
49 let &quot;time++&quot;
50
51 /sbin/shutdown $3 $4 +$time $1 &amp;
52 </programlisting>
53 Shutdown does not return so we need to launch it in background.
54 </para>
55
56         <para>See also <link linkend="ABORTSHUTDOWNSCRIPT">
57         <parameter moreinfo="none">abort shutdown script</parameter></link>.</para>
58 </listitem>
59 </samba:parameter>