Skip to content

Instantly share code, notes, and snippets.

@nshalman
Created November 21, 2013 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nshalman/7575379 to your computer and use it in GitHub Desktop.
Save nshalman/7575379 to your computer and use it in GitHub Desktop.
Example SMF manifest for ghost that would allow the ghost user to listen on a privileged port
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Created by Manifold
-->
<service_bundle type="manifest" name="ghost">
<service name="site/ghost" 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" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/system/filesystem/local"/>
</dependency>
<method_context>
<method_credential user="ghost" group="ghost" privileges="basic,net_privaddr"/>
</method_context>
<exec_method type="method" name="start" exec="/opt/local/bin/npm start" timeout_seconds="60">
<method_context>
<method_environment>
<envvar name="NODE_ENV" value="production"/>
</method_environment>
</method_context>
</exec_method>
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
<property_group name="startd" type="framework">
<propval name="duration" type="astring" value="child"/>
<propval name="ignore_error" type="astring" value="core,signal"/>
</property_group>
<property_group name="application" type="application">
<propval name="config_file" type="astring" value="/opt/ghost/config.js"/>
</property_group>
<stability value="Evolving"/>
<template>
<common_name>
<loctext xml:lang="C">
Ghost Blogging Software
</loctext>
</common_name>
</template>
</service>
</service_bundle>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment