summaryrefslogtreecommitdiff
path: root/docs/smbdotconf/logon/shutdownscript.xml
blob: bd86bfd06dd18ab8216f4e4d66907b88a42e6913 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<samba:parameter name="shutdown script"
                 context="G"
				 type="string"
                 advanced="1" developer="1"
                 xmlns:samba="http://samba.org/common">
<description>
	<para><emphasis>This parameter only exists in the HEAD cvs branch</emphasis>
	This a full path name to a script called by <citerefentry><refentrytitle>smbd</refentrytitle>                                                    
        <manvolnum>8</manvolnum></citerefentry> that should start a shutdown procedure.</para>

	<para>This command will be run as the user connected to the server.</para>

	<para>%m %t %r %f parameters are expanded:</para>
	
	<itemizedlist>
		<listitem>
			<para><parameter moreinfo="none">%m</parameter> will be substituted with the
			shutdown message sent to the server.</para>
		</listitem>
		
		<listitem>
			<para><parameter moreinfo="none">%t</parameter> will be substituted with the
			number of seconds to wait before effectively starting the
			shutdown procedure.</para>
		</listitem>
		
		<listitem>
			<para><parameter moreinfo="none">%r</parameter> will be substituted with the
			switch <emphasis>-r</emphasis>. It means reboot after shutdown
			for NT.</para>
		</listitem>
		
		<listitem>
			<para><parameter moreinfo="none">%f</parameter> will be substituted with the
			switch <emphasis>-f</emphasis>. It means force the shutdown
			even if applications do not respond for NT.</para>
		</listitem>
	</itemizedlist>

	<para>Shutdown script example:
<programlisting format="linespecific">
#!/bin/bash
		
$time=0
let &quot;time/60&quot;
let &quot;time++&quot;

/sbin/shutdown $3 $4 +$time $1 &amp;
</programlisting>
Shutdown does not return so we need to launch it in background.
</para>
</description>
<related>abort shutdown script</related>
<value type="default"></value>
<value type="example">/usr/local/samba/sbin/shutdown %m %t %r %f</value>

</samba:parameter>