Skip to content

Instantly share code, notes, and snippets.

@AlainODea
Last active August 29, 2015 13:58
Show Gist options
  • Save AlainODea/10431222 to your computer and use it in GitHub Desktop.
Save AlainODea/10431222 to your computer and use it in GitHub Desktop.
WIP: SMF manifest for GHC builder client (aka build slave)
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="ghc-builder-client">
<service name="site/ghc-builder-client" 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="ctrun builder-client -v &amp;" timeout_seconds="10">
<method_context working_directory="/home/ghcbld/builder">
<method_credential user="ghcbld" group="ghcbld" />
<method_environment>
<envvar name='HOME' value='/home/ghcbld/builder'/>
<envvar name='PATH' value='/home/ghcbld/.cabal/bin:/usr/local/sbin:/usr/local/bin:/opt/local/sbin:/opt/local/bin:/usr/sbin:/usr/bin:/sbin'/>
<envvar name='LC_ALL' value='en_US.UTF-8'/>
<envvar name='SHELL' value='/bin/bash'/>
</method_environment>
</method_context>
</exec_method>
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="30" />
<template>
<common_name>
<loctext xml:lang="C">GHC builder client</loctext>
</common_name>
</template>
</service>
</service_bundle>
@AlainODea
Copy link
Author

Added -v to get more detailed logging until I'm sure this works reliably.

@AlainODea
Copy link
Author

So far so good. Running smoothly for the last two days and reliably checking in with Gábor's GCH builder server.

@AlainODea
Copy link
Author

Bad path. Doesn't have the PKGSRC installed binaries in it so builds can't even run Git. The above is a bit of a hack.

@AlainODea
Copy link
Author

Have to use ctrun because there are tests that drop core intentionally. SMF's default behavior is to treat any process in the tree of an SMF service dropping core as fatal and to immediately terminate the service. This explains why the output for tests suddenly halts.

@AlainODea
Copy link
Author

Override SHELL to work around bad interaction between autoreconf and /bin/sh being linked to /bin/ksh98.

@AlainODea
Copy link
Author

Set HOME environment for tests that depend on it like ../../libraries/directory/tests getHomeDirectory001

@AlainODea
Copy link
Author

Run as non-root user to avoid the you can do anything permissions results that fail tests like ../../libraries/directory/tests getPermissions001

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