Next update of VFS modules development guide
[Samba.git] / docs / smbdotconf / logon / shutdownscript.xml
blob7e8ec8fd3aaa2c5030d2e9d2f41b9ff5258f6897
1 <samba:parameter name="shutdown script"
2                  context="G"
3                                  type="string"
4                  advanced="1" developer="1"
5                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
6 <description>
7         <para>This a full path name to a script called by 
8          <citerefentry><refentrytitle>smbd</refentrytitle> 
9         <manvolnum>8</manvolnum></citerefentry> that should 
10         start a shutdown procedure.</para>
12         <para>If the connected user posseses the <constant>SeRemoteShutdownPrivilege</constant>,
13         right, this command will be run as user.</para>
15         <para>The %z %t %r %f variables are expanded as follows:</para>
16         
17         <itemizedlist>
18                 <listitem>
19                         <para><parameter moreinfo="none">%z</parameter> will be substituted with the
20                         shutdown message sent to the server.</para>
21                 </listitem>
22                 
23                 <listitem>
24                         <para><parameter moreinfo="none">%t</parameter> will be substituted with the
25                         number of seconds to wait before effectively starting the
26                         shutdown procedure.</para>
27                 </listitem>
28                 
29                 <listitem>
30                         <para><parameter moreinfo="none">%r</parameter> will be substituted with the
31                         switch <emphasis>-r</emphasis>. It means reboot after shutdown
32                         for NT.</para>
33                 </listitem>
34                 
35                 <listitem>
36                         <para><parameter moreinfo="none">%f</parameter> will be substituted with the
37                         switch <emphasis>-f</emphasis>. It means force the shutdown
38                         even if applications do not respond for NT.</para>
39                 </listitem>
40         </itemizedlist>
42         <para>Shutdown script example:
43 <programlisting format="linespecific">
44 #!/bin/bash
45                 
46 $time=0
47 let &quot;time/60&quot;
48 let &quot;time++&quot;
50 /sbin/shutdown $3 $4 +$time $1 &amp;
51 </programlisting>
52         Shutdown does not return so we need to launch it in background.
53         </para>
55 </description>
56 <related>abort shutdown script</related>
57 <value type="default"></value>
58 <value type="example">/usr/local/samba/sbin/shutdown %m %t %r %f</value>
60 </samba:parameter>