summaryrefslogtreecommitdiff
path: root/dh_smf
blob: 7c52208969fd5960b723d800c6a8eeec2f36a7a4 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/perl -w

=head1 NAME

dh_smf - install SMF services into package build directories

=cut

use strict;
use Debian::Debhelper::Dh_Lib;
use File::Find;

=head1 SYNOPSIS

B<dh_smf> [S<I<debhelper options>>] [B<--name=>I<name>] [B<-n>] [B<-R>] [B<-r>]

=head1 DESCRIPTION

B<dh_smf> is a debhelper program that is responsible for installing
SMF manifests and scripts scripts with associated defaults files.

It also automatically generates the F<postinst> and F<postrm> and F<prerm>
commands needed to manage SMF services.

=head1 FILES

=over 4

=item debian/I<package>.smf/

If this directory exists, it is installed as lib/svc/ in the package
build directory.

=item debian/I<package>.default

If this exists, it is installed into etc/default/I<package> in the package
build directory.

=back

=head1 OPTIONS

=over 4

=item B<-n>, B<--noscripts>

Do not modify F<postinst>/F<postrm>/F<prerm> scripts.

=item B<-o>, B<--onlyscripts>

Only modify F<postinst>/F<postrm>/F<prerm> scripts, do not actually install
any files. May be useful if the file is shipped and/or installed by upstream
in a way that doesn't make it easy to let B<dh_smf> find it.

=item B<-R>, B<--restart-after-upgrade>

Do not stop the SMF service until after the package upgrade has been
completed. This is different than the default behavior, which stops the
service in the F<prerm>, and starts it again in the F<postinst>.

This can be useful for daemons that should not have a possibly long
downtime during upgrade. But you should make sure that the daemon will not
get confused by the package being upgraded while it's running before using
this option.

=item B<-r>, B<--no-restart-on-upgrade>

Do not stop the SMF service on upgrade.

=item B<--no-start>

Do not start the service on install or upgrade. Maybe useful if
installing display managers like lightdm or GDM.

=back

=head1 NOTES

Note that this command is not idempotent. L<dh_prep(1)> should be called
between invocations of this command. Otherwise, it may cause multiple
instances of the same text to be added to maintainer scripts.

=cut

init(options => {
	"r" => \$dh{R_FLAG},
	"no-restart-on-upgrade" => \$dh{R_FLAG},
	"no-start" => \$dh{NO_START},
	"R|restart-after-upgrade" => \$dh{RESTART_AFTER_UPGRADE},
});

foreach my $package (@{$dh{DOPACKAGES}}) {
	my $tmp=tmpdir($package);
}

=head1 SEE ALSO

L<debhelper(7)>

This program is a part of debhelper.

=head1 AUTHORS

Joey Hess <joeyh@debian.org> (dh_installinit)

Steve Langasek <steve.langasek@canonical.com>

Michael Stapelberg <stapelberg@debian.org>

Igor Pashev <pashev.igor@gmail.com>

=cut