Illumos/OpenSolaris SMF to FreeBSD

Mark Heily mark at heily.com
Sat Jun 11 05:13:30 UTC 2016


On Sat, Jun 11, 2016 at 12:13 AM, Pedro Giffuni <pfg at freebsd.org> wrote:

> Hi Cy;
>
> Hi,
>>
>> What are people's thoughts about porting Illumos Service Management
>> Facility (SMF) to FreeBSD? The Solaris SMF didn't replace their init(8),
>> it's started by their init(8) through inittab -- we could use ttys or
>> replace init.
>>
>>
> Is this something that could live in ports ... at least for a while?
> It appears there are many options and it's great to be able to choose,
> but I doubt we want to compromise right now on which,
>
>
Full disclosure: I'm working on a competing project called jobd that is
heavily influenced by MacOS launchd and Solaris SMF, while not sharing any
source code with these earlier systems.

I think it would be extremely challenging to port Solaris SMF to FreeBSD
because of the number of dependencies on Solaris-specific kernel features
and libraries. I took some time to investigate these dependencies, based on
the contents of the /usr/srv/cmd/svc directory in Illumos:

https://github.com/illumos/illumos-gate/tree/5a4ef21a18dfdc65328821a265582d03e85a97c9/usr/src/cmd/svc

I grepped all the source code under that directory for the pattern
'#include .*', and came up with a list of all of the system headers that
SMF requires. The list is very large, and includes some major kernel
features like doors, event ports, procfs, kstat, zones, privileges, and so
on.

The source code to SMF has been publicly available for eight years, yet no
one has stepped forward to invest the time and effort to port it to a
different OS. I don't see that situation changing any time soon. Where is
the funding? Who are the commercial backers? How many full-time engineers
will be dedicated to the porting effort? How many years are we willing to
wait for the port to be completed?

IMHO it would be better to borrow the best ideas from the other Unix init
systems and implement them in jobd. It's simply not realistic to port the
original SMF source code to FreeBSD.

P.S. Here are is a partial list of the Solaris-specific facilities that
would need to be ported to FreeBSD to get the Solaris SMF sources to
compile.

Event ports:

https://blogs.oracle.com/barts/entry/entry_2_event_ports


contract(4) filesystem

http://docs.oracle.com/cd/E23823_01/html/816-5174/contract-4.html


corectl(2):

https://github.com/illumos/illumos-gate/blob/5a4ef21a18dfdc65328821a265582d03e85a97c9/usr/src/uts/common/syscall/corectl.c


libgen:

http://docs.oracle.com/cd/E23823_01/html/816-5173/libgen-3head.html


libgrubmgmt:

https://github.com/illumos/illumos-gate/tree/5a4ef21a18dfdc65328821a265582d03e85a97c9/usr/src/lib/libgrubmgmt


libscf:

http://docs.oracle.com/cd/E23824_01/html/821-1464/libscf-3lib.html


libuutil:

https://blogs.oracle.com/sch/entry/libuutil_and_designing_for_debuggability


libumem:

https://blogs.oracle.com/pnayak/entry/finding_memory_leaks_within_solaris


libtecla:

https://docs.oracle.com/cd/E19044-01/sol.containers/817-1592/z.config.ov-18/index.html


libfmevent:

https://docs.oracle.com/cd/E19455-01/805-7224/6j6q44cj5/index.html


kstat kernel support:

https://docs.oracle.com/cd/E23824_01/html/821-1478/kstat-9s.html


libkstat:

https://docs.oracle.com/cd/E19683-01/806-6543/overview-12/index.html


librestart:

https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/librestart/common/librestart.h


libsysevent:

https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libsysevent/libsysevent.c


file tree walker libc functions:

http://docs.oracle.com/cd/E19109-01/tsolaris7/805-8069/6j7j9vntn/index.html


sys/modctl.h:

https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/sys/modctl.h


mnttab functions in sys/mnttab:

http://www.manpages.spotlynx.com/solaris/man/getmntent.3C


procfs:

https://github.com/illumos/illumos-gate/blob/5a4ef21a18dfdc65328821a265582d03e85a97c9/usr/src/uts/common/sys/procfs.h


privileges(5):

http://docs.oracle.com/cd/E36784_01/html/E36883/privileges-5.html#REFMAN5privileges-5


doors:

https://en.wikipedia.org/wiki/Doors_(computing)


SAC port monitors:

https://docs.oracle.com/cd/E19455-01/805-7224/6j6q44cj5/index.html


statvfs:

http://docs.oracle.com/cd/E23824_01/html/821-1463/statvfs-2.html


uadmin(2) system call:

https://illumos.org/man/2/uadmin


Zones:

https://github.com/illumos/illumos-gate/blob/master/usr/src/head/zone.h


More information about the freebsd-arch mailing list