Commit Graph

1351 Commits

Author SHA1 Message Date
Jamie Gritton
abfdc877c6 Don't remove the /var/run/jail_name.id file if a jail fails to start.
This messes up ezjail (and possibly others), when attempting to start
a jail that already exists.

PR:		208806
Reviewed by:	tj
MFC after:	5 days
2016-04-23 16:23:01 +00:00
Lars Engels
6c1a5e837d - Add descriptions to most of the rc scripts. Those are mostly taken from their
daemon's manpage and probably improved.
- Consistently use "filesystem" not "file system".

Approved by:	bapt, brueffer
Differential Revision:	D452
2016-04-23 16:10:54 +00:00
Baptiste Daroussin
49817d14f1 Remove mroute6d rc script
It is directly available via ports (pim6dd which provides the needed rc script)

Reported by:	lme
Sponsored by:	Essen Hackathon 2016
2016-04-23 13:24:45 +00:00
Peter Wemm
e8c6a8339f Turn ssh_host_dsa_key back on until PR#208254 is taken care of. 2016-04-17 03:57:37 +00:00
Glen Barber
d60840138f MFH
Sponsored by:	The FreeBSD Foundation
2016-04-04 23:55:32 +00:00
Kristof Provost
2f396d3cc3 pf: Friendly error message for status if pf.ko is not loaded
Check if pf.ko is loaded (i.e. /dev/pf exists) before trying to use it. This
means that '/etc/rc.d/pf status' will no longer return 'pfctl: /dev/pf: No such
file or directory' but 'pf.ko is not loaded'.

PR:		205671
Submitted by:	Johannes Jost Meixner <xmj@FreeBSD.org>
2016-03-27 17:22:27 +00:00
Jilles Tjoelker
938e6bb267 rc.d: Make msgs a proper rc.d script.
PR:		207149
Reported by:	Jonathan de Boyne Pollard
2016-03-27 16:27:49 +00:00
Glen Barber
538354481e MFH
Sponsored by:	The FreeBSD Foundation
2016-03-14 18:54:29 +00:00
Ian Lepore
e282d8f5bc Require firewall setup before running rc.d/netwait, otherwise the ping
packets sent by netwait may not get through.

PR:		207916
Submitted by:	John.Marshall@riverwillow.com.au (ipfw), ian@ (pf, ipfilter)
2016-03-13 19:42:59 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Dmitry Chagin
7b68aa7b6f Load linux64 module for amd64 if Linux abi enabled.
Reviewed by:	emaste@
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D5567
2016-03-08 19:08:55 +00:00
Glen Barber
52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Mariusz Zaborski
c501d73c7e Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with:		pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by:	drysdale@google.com, bdrewery
Approved by:		pjd (mentor)
Differential Revision:	https://reviews.freebsd.org/D4277
2016-02-25 18:23:40 +00:00
Glen Barber
0fe0fe112f MFH
Sponsored by:	The FreeBSD Foundation
2016-02-15 21:58:52 +00:00
Devin Teske
4fa10b673c Interpret vnet_interface/vnet.interface as array 2016-02-12 02:50:36 +00:00
Cy Schubert
1041b71deb Update leapsecond file in non-chroot environments.
PR:		207095
Submitted by:	madpilot
MFC after:	3 days
2016-02-11 01:16:57 +00:00
Mark Felder
0ba5cf0e44 Add new rc.conf parameter "jail_reverse_stop"
When a user defines "jail_list" in rc.conf the jails are started in the
order defined. Currently the jails are not are stopped in reverse order
which may break dependencies between jails/services and prevent a clean
shutdown. The new parameter "jail_reverse_stop" will shutdown jails in
"jail_list" in reverse order when set to "YES".

Please note that this does not affect manual invocation of the jail rc
script. If a user runs the command

  # service jail stop jail1 jail2 jail3

the jails will be stopped in exactly the order specified regardless of
jail_reverse_stop being defined in rc.conf.

PR:		196152
Approved by:	jamie
MFC after:	1 week
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D5233
2016-02-10 16:13:59 +00:00
Glen Barber
bcefcb026a Create a package for HAST.
Sponsored by:	The FreeBSD Foundation
2016-02-08 21:15:07 +00:00
Glen Barber
9c4fa87c23 Create a package for sendmail(8).
Sponsored by:	The FreeBSD Foundation
2016-02-08 18:41:46 +00:00
Glen Barber
bbb51924bb MFH
Sponsored by:	The FreeBSD Foundation
2016-02-08 12:16:01 +00:00
Glen Barber
0b8bc9c1d1 Create a 'casper' package.
Sponsored by:	The FreeBSD Foundation
2016-02-04 21:17:15 +00:00
Devin Teske
b5d189b6b6 Fix grammar in error statement
s/consider to migrate to jail.conf/consider migrating to jail.conf/
2016-02-04 17:09:43 +00:00
Glen Barber
1d0bd2f971 Include virecover in vi package.
Submitted by:	lidl
Sponsored by:	The FreeBSD Foundation
2016-02-02 21:06:09 +00:00
Glen Barber
45ccd77b60 Fix periodic(8) and rc(8) script inclusion to rcmds package.
Sponsored by:	The FreeBSD Foundation
2016-01-30 01:52:18 +00:00
Glen Barber
87850ff356 Cleanup and organize etc/rc.d/Makefile.
No functional changes.

Sponsored by:	The FreeBSD Foundation
2016-01-29 21:35:24 +00:00
Glen Barber
a5a71822df Fix accounting package rc.d/accounting conflict.
Add periodic(8) accounting scripts to acct package.

Sponsored by:	The FreeBSD Foundation
2016-01-28 18:44:31 +00:00
Glen Barber
0e186c0aab MFH
Sponsored by:	The FreeBSD Foundation
2016-01-27 14:16:13 +00:00
Cy Schubert
f9ddb2af5f Allow specification of fetch options for ntp leap-seconds fetch.
MFC after:	1 week
X-MFC with:	r289421, r293037, r294773
2016-01-27 02:25:25 +00:00
Cy Schubert
b5bdbd0461 Add support for automatic leap-second file updates.
The working copy of leapfile resides in /var/dbntpd.leap-seconds.list.
/etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/
or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should
automatic leapfile updates be disabled (default).

Automatic leapfile updates are fetched from $ntp_leapfile_sources,
defaulting to https://www.ietf.org/timezones/data/leap-seconds.list,
within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds
file expiry. Automatic updates can be enabled by setting
$daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting
the ntp leapfile source the automatic update randomized by default but
can be disabled through daily_ntpd_avoid_congestion="NO" in
periodic.conf.

Suggested by:	des
Reviewed by:	des, roberto, dwmalone, ian, cperciva, glebius, gjb
MFC after:	1 week
X-MFC with:	r289421, r293037
2016-01-26 07:06:44 +00:00
Jamie Gritton
0e00d580ff Allow the (old rc-style) exec_afterstart jail parameters to start numbering
at 0, like exec_prestart and the others do.  Make param0 optional, i.e.
still look for param1.

PR:		142973
MFC after:	3 days
2016-01-25 22:14:31 +00:00
Glen Barber
f9421853ad MFH
Sponsored by:	The FreeBSD Foundation
2016-01-25 14:13:28 +00:00
Dag-Erling Smørgrav
a65e87276e Do not generate RSA1 or DSA keys by default. 2016-01-22 12:14:08 +00:00
Glen Barber
396953934d Create a package for apm(8).
Sponsored by:	The FreeBSD Foundation
2016-01-21 18:41:55 +00:00
Glen Barber
4ffb51fe89 Create a package for amd(8) and related tools.
While here, fix accounting rc script installation.

Sponsored by:	The FreeBSD Foundation
2016-01-21 18:19:33 +00:00
Glen Barber
ed0d921874 Add a package for jail(8) and related utilities.
Sponsored by:	The FreeBSD Foundation
2016-01-20 17:07:13 +00:00
Glen Barber
59d43d11fe MFH
Sponsored by:	The FreeBSD Foundation
2016-01-20 09:50:54 +00:00
Warner Losh
4153c21113 Add ldconfig -soft to process the soft float abi libraries and put it
into startup scripts for armv6. It acts much like ldconfig -32 does.
2016-01-18 21:40:18 +00:00
Edward Tomasz Napierala
a9a9fa410d Wrap overlong comment lines.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-01-14 16:55:07 +00:00
Edward Tomasz Napierala
0851a9b1a1 Fix the code to retry mount attempt in mountcritlocal if there are
any root mount holds.  The previous one used a wrong conditional - the
"err=$?" assignment resets "$?" to 0.

Submitted by:	jilles@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-01-14 16:53:17 +00:00
Glen Barber
b626f5a73a MFH r289384-r293170
Sponsored by:	The FreeBSD Foundation
2016-01-04 19:19:48 +00:00
Jamie Gritton
e4e5904ffe Let old-style (shell-based) jail configuration handle jail names that
contain characters not allowed in a shell variable (such as "-").
These will be replaced by an underscore in jail config variables,
e.g. for jail "foo-bar" you would set "jail_foo_bar_hostname".

This is separate from the current code that changes the jail names
if they contain "." or "/".  It also doesn't apply to jails defined
in a jail.conf file.

PR:		191181
MFC after:	5 days
2015-12-26 23:01:34 +00:00
Ian Lepore
630c9dba7a Enhance rc.d/netwait script to wait for late-attaching interfaces such as
USB NICs.

USB network hardware may not be enumerated and available when the rc.d
networking scripts run. Eventually the USB attachment completes and devd
events cause the network initialization to happen, but by then other rc.d
scripts have already failed, because services which depend on NETWORKING
(such as mountcritremote) may end up running before the network is actually
ready.

There is an existing netwait script, but because it is dependent on
NETWORKING it runs too late to prevent failure of some other rc
scripts. This change flips the order so that NETWORKING depends on netwait,
and netwait now depends on devd and routing (the former is needed to make
interfaces appear, and the latter is needed to run the ping tests in
netwait).

The netwait script used to be oriented primarily towards "as soon as any
host is reachable the network is fully functional", so you gave it a list of
IPs to try and you could optionally name an interface and it would wait for
carrier on that interface. That functionality still works the same, but now
you can provide a list of interfaces to wait for and it waits until each one
of them is available. The ping logic still completes as soon as the first IP
on the list responds.

These changes were submitted by Brenden Molloy <brendan+freebsd@bbqsrc.net>
in PR 205186, and lightly modified by me to allow a list of interfaces
instead of just one.

PR:		205186
Differential Revision:	https://reviews.freebsd.org/D4608 (timeout w/o review)
2015-12-26 18:21:32 +00:00
Edward Tomasz Napierala
0a2a3753ef Modify the rctl rc script to add multiple rules in a single run.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-12-01 16:42:39 +00:00
Dag-Erling Smørgrav
a677ee8beb Load our configuration before setting defaults, so local_unbound_workdir
actually has an effect.

PR:		204931
Submitted by:	Eugene Grosbein <eugen@grosbein.net>
MFC after:	1 week
2015-12-01 13:20:21 +00:00
Rick Macklem
b45c941c1c Add support for the new "-manage-gids" option for the nfsuserd daemon
to the rc scripts. With these changes, setting nfs_server_managegids="YES"
in /etc/rc.conf will enable this capability.

Suggested by:	jpaetzel
Tested by:	jpaetzel
Reviewed by:	rc (pending)
MFC after:	2 weeks
2015-11-30 22:29:11 +00:00
Bryan Drewery
6662a8e56b When extracting mtrees, pass -i so schg/sappnd are respected.
This fixes /var/empty not being schg in the installation.

This was a change from fmtree to nmtree, that -i is now required to
apply these flags.

PR:		194189
Submitted by:	guyyur@gmail.com
MFC after:	2 weeks
Relnotes:	yes
2015-11-09 23:37:01 +00:00
Edward Tomasz Napierala
665aea9323 After r290196, the kernel won't wait for stuff like gmirror nodes
if they are not required for mounting rootfs.  However, it's possible
that some setups try to mount them in mountcritlocal (ie from fstab).

Export the list of current root mount holds using a new sysctl,
vfs.root_mount_hold, and make mountcritlocal retry if "mount -a" fails
and the list is not empty.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3709
2015-10-30 15:52:10 +00:00
Devin Teske
75fe15ab68 Ignore per-mdN settings in mdconfig[2] startup
PR:		base/189696
Submitted by:	ganael.laplanche@martymac.org
MFC after:	3 days
X-MFC-to:	stable/10 stable/9
2015-10-29 21:12:57 +00:00
Dag-Erling Smørgrav
ded9988b76 Since r275359, there is no need to provide a bogus service name.
MFC after:	3 weeks
2015-10-26 15:16:27 +00:00
Poul-Henning Kamp
3fbbfad5d0 Allow osreldate and osrelease to be set per jail 2015-10-20 12:49:38 +00:00