From owner-freebsd-arch@freebsd.org Sat Jun 11 05:13:30 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20327AEF22B for ; Sat, 11 Jun 2016 05:13:30 +0000 (UTC) (envelope-from mark@heily.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7D412994 for ; Sat, 11 Jun 2016 05:13:29 +0000 (UTC) (envelope-from mark@heily.com) Received: by mail-io0-x236.google.com with SMTP id 5so82004195ioy.1 for ; Fri, 10 Jun 2016 22:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heily-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=6vEDPnFYKQ8qy03mkslRHlx6ra8rLDzacY/CBjkYx1E=; b=ghm12LXd/fRhy4xl6CUgyU7dWgpqYbSmBm0qbRJ25X7kgEL7vD4kpRxqHgpVpMfpuY QEx5WTNr7a9/al4vu5EH61aME/2My72cgY7PU3FJh/njZwBJuMx1YeedUKZGYLA0GyM4 0SsFyR9OIQl2v+rEfl5HvMwBU4LeqJ6OtBMRbqgTd7RT/7snfmIfgmO2M1DizuOndSD3 shVGasmfE2RNGFbTsi7LtqNRf28h+sU23QAkxxu698GD8zx8qYSJ2L45GDUv4X8qMmo7 HGjbp+tjnW9RpYMgWgve2oKoM7fFSBJayzReSEMcJQuFgoSsflPJpFkWuwt+WS19SgG6 m1vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=6vEDPnFYKQ8qy03mkslRHlx6ra8rLDzacY/CBjkYx1E=; b=QvS/vEOV8YhF0k52KoGyTBa0TEIJRttY3/cyyBY3+4noT1LUGxmZ1aL/aPe9CMHg95 rhN3Hvqj8dU6zhJV0s5/GzWtR3FJbKatjz53u3G1p01zhGnZKMtQbgM2SG8YXEmBUz+x ghUWFToCXyzwYqvZrG4YdxHNF+KJAJpX91xdNVt5NrZV5t2Rlsm7ZMY0eH959yNdJFv2 9pHbe+wWqUgxwibIjmS+Y9Qgmr9gzdKSFGo3pxLqkDW830PfZr9p9r2y0iXqAEOs3nUK V7tGuVLxWdP27eeymxizLTVD3PfnWfnQ7rh8oAxT4WmYxlOdXgxpocrUQZFj3QMiIROo ewXg== X-Gm-Message-State: ALyK8tL3qoHxJRPA/UuatJhwF+yKP4tMCMQcz9kACpvtFVJKe3LIsfxGzigJn8b4rR2Ybc2OGvQwWGsXeGdZnA== MIME-Version: 1.0 X-Received: by 10.107.38.10 with SMTP id m10mr10134320iom.7.1465622009178; Fri, 10 Jun 2016 22:13:29 -0700 (PDT) Received: by 10.79.114.156 with HTTP; Fri, 10 Jun 2016 22:13:29 -0700 (PDT) X-Originating-IP: [137.122.64.52] In-Reply-To: References: Date: Sat, 11 Jun 2016 01:13:29 -0400 Message-ID: Subject: Re: Illumos/OpenSolaris SMF to FreeBSD From: Mark Heily To: Pedro Giffuni Cc: FreeBSD-arch list Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 05:13:30 -0000 On Sat, Jun 11, 2016 at 12:13 AM, Pedro Giffuni 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