Skip to content

Instantly share code, notes, and snippets.

@AlainODea
Last active December 21, 2015 14:39
Show Gist options
  • Save AlainODea/6321603 to your computer and use it in GitHub Desktop.
Save AlainODea/6321603 to your computer and use it in GitHub Desktop.
An SMF manifest for ISC DHCP on SmartOS
#!/bin/bash
curl https://gist.githubusercontent.com/AlainODea/6321603/raw/760ebf43a2f48a78d99b8ca6dbc98a4b84684647/isc-dhcpd-smf.xml > /opt/local/lib/svc/manifest/isc-dhcpd-smf.xml
svccfg import /opt/local/lib/svc/manifest/isc-dhcpd-smf.xml
echo Run 'svcadm enable svc:/pkgsrc/isc-dhcpd:default' to enable ISC DHCP Daemon after configuration
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="isc-dhcpd">
<service name="pkgsrc/isc-dhcpd" type="service" version="1">
<create_default_instance enabled="false" />
<single_instance />
<dependency name='network' grouping='require_all' restart_on='error' type='service'>
<service_fmri value='svc:/milestone/network:default' />
</dependency>
<dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local:default' />
</dependency>
<exec_method type="method" name="start" exec="/opt/local/sbin/dhcpd &amp;" timeout_seconds="10">
<method_context>
<method_credential user="root" group="root" />
</method_context>
</exec_method>
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="30" />
<template>
<common_name>
<loctext xml:lang="C">ISC DHCP Server</loctext>
</common_name>
</template>
</service>
</service_bundle>
@danmcd
Copy link

danmcd commented Jun 4, 2014

Care to code review a more thorough one we're doing for OmniOS? It's still a work in progress (v6 relay needs real help, and other services may need svccfg variables as well).

http://kebe.com/~danmcd/webrevs/ob-dhcpd/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment