OpenRC vs rc.d. Compare and contrast

Similar documents
Advanced Unix System Administration

Automating Linux App Startup

Authored by: Brian E. Brzezicki Copyright 2013, Paladin Group LLC Reuse without permission is strictly prohibited

Automating Linux App Startup

RHCE BOOT CAMP. The Boot Process. Wednesday, November 28, 12

C Commands. Cisco Nexus 5500 Series NX-OS System Management Command Reference 1

simplevisor Documentation

VREDPro HPC Raytracing Cluster

Remote GUI access to a Linux computer using Tightvnc

Writing LCFG components

runit and ignite: a suckless init system? Christian Neukirchen slcon jun2013

Your Computer; Your Init; Your Choice

Proceedings of the FREENIX Track: 2001 USENIX Annual Technical Conference

Initialization: runlevels

ameh Documentation Release Eric Pierce

systemd: Converting sysvinit scripts

CS 550 Operating Systems Spring Process II

Supercharged VM Startup: A System V-Style INIT Process for VM and Guests

CSE 265: System and Network Administration

CSE 265: System and Network Administration

FreeBSD Jails vs. Solaris Zones

Process Management forks, bombs, zombies, and daemons! Lecture 5, Hands-On Unix System Administration DeCal

Introduction to Linux Init Scripts

Computer System Administration Homework 3 File Server. fchsieh / zswu

CS 550 Operating Systems Spring Process III

Basic Shell Commands. Bok, Jong Soon

Integration of UNICORE Components into Linux Systems

Getting Started with MySQL

Arm Licence Server User Guide. Version 18.0

Working with Ubuntu Linux. Track 2 Workshop June 2010 Pago Pago, American Samoa

OpenBSD rc.d(8) Antoine Jacoutot. The OpenBSD project. Abstract. 1. Introduction. 2. Description of rc on OpenBSD

Automating the deployment of FreeBSD & PC-BSD systems

Configuring Multiple Instances of Railo on Linux

Services, logging, accounting Todd Kelley CST8177 Todd Kelley 1

The Linux IPL Procedure

Booting Up and Shutting Down. lctseng / Liang-Chi Tseng

Using grub to Boot various Operating Systems

"Charting the Course... Enterprise Linux System Administration Course Summary

Contents in Detail. Acknowledgments

Ubuntu Sever Administration. Duration:40 Hrs

Booting: ROM vs RAM The term random access memory is somewhat misleading because DRAM, SRAM and ROM all qualify as random access memories We will

Booting Up and Shutting Down

Chapter 2 Booting Up and Shutting Down

The Linux Boot Process

OPERATING SYSTEMS LINUX

minit Felix von Leitner September 2004 minit

Study Guide Processes & Job Control

Manual Shell Script Linux If Not Equal String Comparison

arxiv:cs/ v2 [cs.os] 9 Jan 2005

HOW LINUX BOOTS. As it turns out, there isn t much to the boot process:

Let SMF handle your service Detlef Drewanz

Best practices on deployment of IBM Rational. servers

Magento Extension User Guide PRODUCTS FINDER SOLUTION. for Magento 2

System Administration. Startup Process

Some Practical Matters. Introduction to Unix. What's Our Goal? Linux!= UNIX

BEAWebLogic Server. Node Manager Administrator s Guide

BIRD Internet Routing Daemon

Tutorial 4 Cloud Service Performance Benchmarking Disclaimer: Subject to updates as corrections are found Version 0.10

ENTERPRISE LINUX SYSTEM ADMINISTRATION

CompTIA Linux+/LPIC-1 COPYRIGHTED MATERIAL

swiftenv Documentation

University of Pennsylvania Zachary Goldberg. CIS c. More Kernel Bits. 10/03/09 Slide 1

Tutorial : Confguring a micro SD memory card as both swap and storage area for the DragonBoard 410c (DB410C)

GL-280: Red Hat Linux 7 Update. Course Description. Course Outline

systemd our next-generation init system PABLO N. HESS Instructor Red Hat São Paulo December 2011

Processes. CS3026 Operating Systems Lecture 05

More on file systems, Booting Todd Kelley CST8177 Todd Kelley 1

Enterprise Linux System Administration

1 LINUX KERNEL & DEVICES

Lab 3a Using the vi editor

This material is based on work supported by the National Science Foundation under Grant No

VNSTAT.CONF(5) User Manuals VNSTAT.CONF(5)

More on file systems, Booting Todd Kelley CST8177 Todd Kelley 1

Men & Mice Suite 5.6

Yum Extender Documentation

init rides the rocket: systemd is here Olaf Kirch

LPIC 102. be familiar with standard runlevels in a Linux system

Istanbul Kemerburgaz University. UNIX FreeBSD CPU Scheduling

FreeBSD Overview Comparison with Linux. Welcome. Class Schedule. Some Practical Matters. Introduction. SANOG VI IP Services Workshop

systemd: What to Know and How to Transition

UCI Command Line Interface Reference

Installation and Administration Guide

Porting a Linux package manager and Build System for PacBSD

The powerful Bcfg2 provides a sophisticated environment for centralized configuration management. uses a powerful, abstract approach.

Communication protocols and services

Unix / Linux Overview

Project #3: Implementing NIS

Programs. Program: Set of commands stored in a file Stored on disk Starting a program creates a process static Process: Program loaded in RAM dynamic

Manually Update To Windows 100 Cpu Xp Sp3

IBM Scheduler for High Throughput Computing on IBM Blue Gene /P Table of Contents

Die Brummbeere Documentation

Collect Information for Issue Report

Linux crash lecture by Andrey Lukyanenko

VMWare Tools Installation in IPBrick 5.3

Systemd. The giant monster that ate Linux

AppGate 11.0 RELEASE NOTES

Linux Systems Administration Getting Started with Linux

FreeSWITCH for Ubuntu 14.04

F3RP61 boot up with EPICS IOC

"Charting the Course... RHCE Rapid Track Course. Course Summary

Transcription:

OpenRC vs rc.d Compare and contrast

Quick OpenRC FAQ Q. Is OpenRC an init system? Yes - IF you want to use it that way. OpenRC was originally designed only as an rc system. This is how TrueOS uses it, but other projects do use OpenRC as an init system. Q. Is OpenRC infected by the GPL license? Yes and No. OpenRC itself is available under the 2-clause BSD license, but some individual applications may use the GPL for their service files. Most of the GPL services are Linux specific and TrueOS has provided BSDlicensed replacements for many of them. Q. What are OpenRC runlevels? Isn t that a Linux thing? While the term runlevel originated with the sysv init system and refers to numeric states of the system, OpenRC runlevels refer to something different. Each OpenRC runlevel is a logical group of services that are started in a designated order. Service dependency handling is always evaluated within the runlevel. There are two predefined runlevels in OpenRC: boot is the first runlevel. Only base system services (/etc/init.d) can be placed in boot. default has no restrictions on what can be placed in it.

Quick differences between OpenRC and rc.d Enable service at boot Disable service at boot OpenRC `rc-update add [service] [runlevel]` `rc-update delete [service] [runlevel]` rc.d `sysrc [service]_enable=yes` `sysrc [service]_enable=no` Check service status `rc-status` or `service [name] status` `service [name] status` (not well supported by most services) Interact with a service `service [name] [action]` `service [name] (one)[action]` Location of service files [/usr/local]/etc/init.d [/usr/local]/etc/rc.d Written in C Shell

rc.d example: /usr/local/etc/rc.d/cupsd (print/cups) #!/bin/sh # # $FreeBSD$ # # PROVIDE: cupsd # REQUIRE: DAEMON # KEYWORD: shutdown #. /etc/rc.subr name="cupsd" rcvar="cupsd_enable" start_precmd="${name}_prestart" command="/usr/local/sbin/cupsd" extra_commands="reload" cupsd_prestart() { if [ -n "$TZ" ]; then export TZ fi } load_rc_config ${name} : ${cupsd_enable=no} run_rc_command "$1"...

OpenRC example: /usr/local/etc/init.d/cupsd #!/sbin/openrc-run command=/usr/local/sbin/cupsd command_args="-f" name="cupsd" supervisor=supervise-daemon pidfile="/var/run/cupsd.pid" depend() { provide cups need localmount after dbus avahi-daemon } Value added by this shorter file: Easier to read/modify Service is supervised (autorestarted if binary crashes) Ensures that dbus/avahi services are started before this (if they are enabled) Service status is always available

Writing an OpenRC service from scratch SERVICE FILE (init.d/dummy) #!/sbin/openrc-run name= dummy description= dummy service command=/usr/local/bin/dummy command_args= -foreground ${dummy_args} supervisor=supervise-daemon pidfile= /var/run/dummy.pid output_log= /var/log/dummy.log error_log=${output_log} depend(){ need localmount after network } NOTES: <- This is not #!/bin/sh <- Arguments for the command: dummy_args comes from the rc.conf files OR conf.d/[service_name] <- Logfiles for standard output/error are easily specified <- need : Ensure this service is running first <- after : If enabled, start this service first

OpenRC dependency handling Keywords for the depend() section: need: These services are automatically started prior to the current service. If any are stopped or restarted, this service is also stopped or restarted in the proper order. This service will not be started if another required service is unavailable or cannot start. use: These services are automatically started prior to this service only if enabled in the runlevel. want: specify a service to start after another named service. after/before: Set start/stop order based on these other services. provide: alternate name this service provides. Example: ntpd and openntpd can both provide the ntp name, allowing other services to just need/use ntp instead of a specifc ntp service. config: List of fles that the service will monitor and recalculate dependencies if changed keyword: Additional fags for confguring service behavior (-shutdown, -timeout, - jail)